From patchwork Mon Mar 21 18:33:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Mickler X-Patchwork-Id: 648581 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 p2LIZlWV014097 for ; Mon, 21 Mar 2011 18:35:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754193Ab1CUSeE (ORCPT ); Mon, 21 Mar 2011 14:34:04 -0400 Received: from ist.d-labs.de ([213.239.218.44]:43617 "EHLO mx01.d-labs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161Ab1CUSeB (ORCPT ); Mon, 21 Mar 2011 14:34:01 -0400 Received: from schatten.dmk.lab (f053218247.adsl.alicedsl.de [78.53.218.247]) by mx01.d-labs.de (Postfix) with ESMTPSA id B5DA37F8DF; Mon, 21 Mar 2011 19:34:00 +0100 (CET) Received: by schatten.dmk.lab (Postfix, from userid 1000) id 1A043C5C076; Mon, 21 Mar 2011 19:34:00 +0100 (CET) From: Florian Mickler To: mchehab@infradead.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, js@linuxtv.org, tskd2@yahoo.co.jp, liplianin@me.by, g.marco@freenet.de, aet@rasterburn.org, pb@linuxtv.org, mkrufky@linuxtv.org, nick@nick-andrew.net, max@veneto.com, janne-dvb@grunau.be, Florian Mickler Subject: [PATCH 1/6] [media] a800: get rid of on-stack dma buffers Date: Mon, 21 Mar 2011 19:33:41 +0100 Message-Id: <1300732426-18958-2-git-send-email-florian@mickler.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1300732426-18958-1-git-send-email-florian@mickler.org> References: <1300732426-18958-1-git-send-email-florian@mickler.org> 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]); Mon, 21 Mar 2011 18:35:47 +0000 (UTC) diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c index 53b93a4..fe2366b 100644 --- a/drivers/media/dvb/dvb-usb/a800.c +++ b/drivers/media/dvb/dvb-usb/a800.c @@ -78,17 +78,26 @@ static struct rc_map_table rc_map_a800_table[] = { static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) { - u8 key[5]; + int ret; + u8 *key = kmalloc(5, GFP_KERNEL); + if (!key) + return -ENOMEM; + if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0), 0x04, USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, key, 5, - 2000) != 5) - return -ENODEV; + 2000) != 5) { + ret = -ENODEV; + goto out; + } /* call the universal NEC remote processor, to find out the key's state and event */ dvb_usb_nec_rc_key_to_event(d,key,event,state); if (key[0] != 0) deb_rc("key: %x %x %x %x %x\n",key[0],key[1],key[2],key[3],key[4]); - return 0; + ret = 0; +out: + kfree(key); + return ret; } /* USB Driver stuff */