From patchwork Fri Apr 22 09:07:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 726571 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3M97oVh000329 for ; Fri, 22 Apr 2011 09:07:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753856Ab1DVJHs (ORCPT ); Fri, 22 Apr 2011 05:07:48 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:50760 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753618Ab1DVJHs (ORCPT ); Fri, 22 Apr 2011 05:07:48 -0400 Received: by wya21 with SMTP id 21so319193wya.19 for ; Fri, 22 Apr 2011 02:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=N11Woe5BMBz80LjaM0ZBkuxU7s4NPYAXuu8N3Y61I0g=; b=dso3WiogprNPD2EcPh1F3DwN8Pml39nBDhRcXK5S90QWdNSDnEFYuqfVeGB4k0ESKm ukODYMz7MtIp+Hw47zGk7VG4+ErXmKMf//pyUiJ9bpcVrkoGnsEXTH2I7pDVWYoqr2qK ocu5/IYW9sTtjTTP8LwoIqZdGR9TmhIBS1D/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=bxNU0bmcTYGygDl4gXIAEIAHhXK5h4r217jBnjMZMR+ejT9YitfiFwBAWaY+V+Yi3d CLk0yVhGHRksMfsLRlb9V+miCgxXutmVLYcmyIsrOFUq9FGf/M8Skf/UlaqpBqACRfUh nLMI1w29e9M4Z86k2uqYGgEPK6OGBKgqHIE8E= Received: by 10.227.12.13 with SMTP id v13mr909104wbv.134.1303463267069; Fri, 22 Apr 2011 02:07:47 -0700 (PDT) Received: from [10.64.64.65] (94.197.127.230.threembb.co.uk [94.197.127.230]) by mx.google.com with ESMTPS id bs4sm1637700wbb.18.2011.04.22.02.07.45 (version=SSLv3 cipher=OTHER); Fri, 22 Apr 2011 02:07:46 -0700 (PDT) Subject: [PATCH 1/2] [BUG]DM04/QQBOX v1.85 usb_buffer and mutex. From: Malcolm Priestley To: linux-media@vger.kernel.org Date: Fri, 22 Apr 2011 10:07:40 +0100 Message-ID: <1303463260.2525.4.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Apr 2011 09:07:51 +0000 (UTC) usb_buffer not inside mutex lock, waiting caller can alter buffer. Static added to lme2510_exit and lme2510_exit_int. Signed-off-by: Malcolm Priestley --- drivers/media/dvb/dvb-usb/lmedm04.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c index 4e5c521..aa9a6ff 100644 --- a/drivers/media/dvb/dvb-usb/lmedm04.c +++ b/drivers/media/dvb/dvb-usb/lmedm04.c @@ -169,14 +169,14 @@ static int lme2510_usb_talk(struct dvb_usb_device *d, } buff = st->usb_buffer; - /* the read/write capped at 512 */ - memcpy(buff, wbuf, (wlen > 512) ? 512 : wlen); - ret = mutex_lock_interruptible(&d->usb_mutex); if (ret < 0) return -EAGAIN; + /* the read/write capped at 512 */ + memcpy(buff, wbuf, (wlen > 512) ? 512 : wlen); + ret |= usb_clear_halt(d->udev, usb_sndbulkpipe(d->udev, 0x01)); ret |= lme2510_bulk_write(d->udev, buff, wlen , 0x01); @@ -1234,7 +1234,7 @@ static struct dvb_usb_device_properties lme2510c_properties = { } }; -void *lme2510_exit_int(struct dvb_usb_device *d) +static void *lme2510_exit_int(struct dvb_usb_device *d) { struct lme2510_state *st = d->priv; struct dvb_usb_adapter *adap = &d->adapter[0]; @@ -1261,7 +1261,7 @@ void *lme2510_exit_int(struct dvb_usb_device *d) return buffer; } -void lme2510_exit(struct usb_interface *intf) +static void lme2510_exit(struct usb_interface *intf) { struct dvb_usb_device *d = usb_get_intfdata(intf); void *usb_buffer; @@ -1303,5 +1303,5 @@ module_exit(lme2510_module_exit); MODULE_AUTHOR("Malcolm Priestley "); MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); -MODULE_VERSION("1.84"); +MODULE_VERSION("1.85"); MODULE_LICENSE("GPL");