From patchwork Sun Sep 13 03:23:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ellingsworth X-Patchwork-Id: 47127 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8D3VTX1005723 for ; Sun, 13 Sep 2009 03:31:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754930AbZIMDbZ (ORCPT ); Sat, 12 Sep 2009 23:31:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754935AbZIMDbZ (ORCPT ); Sat, 12 Sep 2009 23:31:25 -0400 Received: from qw-out-2122.google.com ([74.125.92.25]:9038 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754926AbZIMDbZ (ORCPT ); Sat, 12 Sep 2009 23:31:25 -0400 Received: by qw-out-2122.google.com with SMTP id 9so722164qwb.37 for ; Sat, 12 Sep 2009 20:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :reply-to:user-agent:mime-version:to:subject:content-type; bh=4UNcHrUidwueLbwKlHFZ1Sg4CO+cJ6lGAkSPKAD+uTw=; b=Fwpe/5+/IfzLXnLL0u5Z2qTTN+DIvLnMuo05VXh5CYN1qJ48YAvHlEJi1H6NDErjHG 0c0CBuIGg5tWT94rvWmiBMyNWN919qoLwzjAZxMuGD9ewYexTAjukcIKRPMbZgP/ha/B B8j7wEL/cylC7/aHRXsblBOWJaL+bkTpq8QfY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:content-type; b=Lz1JVDiylOLiJmINSLXet+SRRniak9l+66X49b6Cio1P9GyYXAOlIaInl+yboeWYlC T/tS/GnwoV3Wr5+N9s6RHgXvvBQrmWNb3lrQpWswJYKtSEcQnUUsmH3OZ+Te58YvfR3g NatVSc5qMBVy4qQ/ytRGC9PX/xGKLYFfXmbSo= Received: by 10.224.91.74 with SMTP id l10mr4103024qam.241.1252812205474; Sat, 12 Sep 2009 20:23:25 -0700 (PDT) Received: from ?192.168.10.110? (cpe-71-72-62-249.neo.res.rr.com [71.72.62.249]) by mx.google.com with ESMTPS id 6sm3154807qwd.33.2009.09.12.20.23.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Sep 2009 20:23:24 -0700 (PDT) Message-ID: <4AAC65A3.4010607@gmail.com> Date: Sat, 12 Sep 2009 23:23:15 -0400 From: David Ellingsworth Reply-To: david@identd.dyndns.org User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: linux-media@vger.kernel.org, klimov.linux@gmail.com Subject: [RFC/RFT 14/14] radio-mr800: set radio frequency only upon success Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001 From: David Ellingsworth Date: Sat, 12 Sep 2009 16:04:44 -0400 Subject: [PATCH 08/14] mr800: fix potential use after free Signed-off-by: David Ellingsworth --- drivers/media/radio/radio-mr800.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) /* vidioc_querycap - query device capabilities */ From 1c62f52da6114756d16644f8401f1903a50ae455 Mon Sep 17 00:00:00 2001 From: David Ellingsworth Date: Sat, 12 Sep 2009 22:03:56 -0400 Subject: [PATCH 14/14] mr800: set radio frequency only upon success Signed-off-by: David Ellingsworth --- drivers/media/radio/radio-mr800.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 4d955aa..f609fdf 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -235,6 +235,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq) if (retval < 0 || size != BUFFER_LENGTH) goto out_err; + radio->curfreq = freq; goto out; out_err: @@ -370,13 +371,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, struct v4l2_frequency *f) { struct amradio_device *radio = file->private_data; - int retval = 0; - - radio->curfreq = f->frequency; - retval = amradio_setfreq(radio, radio->curfreq); - - return retval; + return amradio_setfreq(radio, f->frequency); } /* vidioc_g_frequency - get tuner radio frequency */ -- 1.6.3.3