From patchwork Sun Sep 13 03:22:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ellingsworth X-Patchwork-Id: 47124 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 n8D3TGCk005574 for ; Sun, 13 Sep 2009 03:29:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754471AbZIMD3M (ORCPT ); Sat, 12 Sep 2009 23:29:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754131AbZIMD3M (ORCPT ); Sat, 12 Sep 2009 23:29:12 -0400 Received: from mail-qy0-f185.google.com ([209.85.221.185]:34967 "EHLO mail-qy0-f185.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754053AbZIMD3L (ORCPT ); Sat, 12 Sep 2009 23:29:11 -0400 X-Greylist: delayed 391 seconds by postgrey-1.27 at vger.kernel.org; Sat, 12 Sep 2009 23:29:11 EDT Received: by qyk15 with SMTP id 15so1729687qyk.15 for ; Sat, 12 Sep 2009 20:29:13 -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=148I4628OtInOjFIXKLhL3e+qqA1Lx5nQy2ixwje+bk=; b=YWqZLbbeVV2F6ljIH+dv25vRGYE8Z8d9EiufORnpuKTVZ46pqNuXVh//GNmuw/eFI+ u9HjcLSRhs6u36iBE7OvDpqtoQCeCkmBBPlSCOzZO5uWxNTavJ+L1OvDPzzYRI6QHS5N z5PRhCE+XR5oGiwJcSEJaiECP5pdaeiHg2Jvw= 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=bUiuyW+qIKkku2SXoXGGtz+leApuxiNtXhQgQrUp+gMpN41W3wOKqMNLV5FkxozUi9 6UjEO/mTFEuiRjJvOC6Cqg9aLGnHad5+jtapPsBxmpawYKlDiM1EZuTw9Mp9StMUuDFl whwPb4bDEyAwc6EqJsSwrhKAbGZFKPvkYMj78= Received: by 10.224.7.16 with SMTP id b16mr3419951qab.94.1252812184742; Sat, 12 Sep 2009 20:23:04 -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 7sm2965696qwb.44.2009.09.12.20.23.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Sep 2009 20:23:04 -0700 (PDT) Message-ID: <4AAC658E.80401@gmail.com> Date: Sat, 12 Sep 2009 23:22:54 -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 11/14] radio-mr800: fix behavior of set_stereo function 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 ea0c11ec6706fbd0777b0147da8a8a827a537699 Mon Sep 17 00:00:00 2001 From: David Ellingsworth Date: Sat, 12 Sep 2009 22:00:29 -0400 Subject: [PATCH 11/14] mr800: fix behavior of set_stereo function Signed-off-by: David Ellingsworth --- drivers/media/radio/radio-mr800.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index dbf0dbb..8fc413d 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c @@ -252,12 +252,13 @@ static int amradio_set_stereo(struct amradio_device *radio, char argument) retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2), (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT); - if (retval < 0 || size != BUFFER_LENGTH) { - radio->stereo = -1; + if (retval < 0 || size != BUFFER_LENGTH) return retval; - } - radio->stereo = 1; + if (argument == WANT_STEREO) + radio->stereo = 1; + else + radio->stereo = 0; return retval; } -- 1.6.3.3