Received: by 10.223.185.116 with SMTP id b49csp6327524wrg; Wed, 28 Feb 2018 07:38:16 -0800 (PST) X-Google-Smtp-Source: AH8x225Rmp5d5EXFNbcmJJmd3S1MFVemAvNnp+nRSviVqOtLCD4lYks7JsHlTYls1UDH908DSdn7 X-Received: by 10.99.110.131 with SMTP id j125mr14682947pgc.382.1519832296247; Wed, 28 Feb 2018 07:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519832296; cv=none; d=google.com; s=arc-20160816; b=KlEeLYDbQYrD4hfZhir8jHHvbYAL7cS0x6gRRNYNjOt7AlfeguEoMHwc4o2WTmmJHb iHsu4jFQ40fYh82UbRtTJSKwrJLgub+jFJLDjbzp1YNxN1l2gUYXxx3hazIZgikIHyXq IP8BgKx9cg1V02qM5cn2QciSlcRPjei2z5pZ0JPR13a3GWvRWPSIf89ibVOSlg3KKQWK 2DE3XO0N2K+bV89p9HkyHDYcIlavpEb61zYDWnO5fBW9h5QA85h6dCjxD2ca1vEkFSeD VqJjicPAlCJKgI/pbxiSbXpg56+X2G/oFtZMwi1VdUz878Ytjw7yzIApQCKmJP2qVksr wZ9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=7M1tUzs2e9LzQ2xm+993TPJgFPjHJWV1nFU1Q0nuFc0=; b=mqpaWoB3RC92UGqpHmpUWMC1AU5jF2Q72ndpibgW0D0/O3oNhLIUbHizYAXMq8sd5L 52Gg97GUoxonwr2XSOniFGDbzmgNB6sf2puqrHvGQXudcdY7PIy0JzideH0ntkskN/K1 HoetS7pGuN0qhzsQxS/zdUTrGnpJHmJ95OrejNeC14cGBPzUBR/h0RHczf329S3U5qtM wR8Gjx8xs7r7whLzydv7P7XRHGbeTmiuW6F7qQOJ8ltjI0qWpgA20dUJtuAqzRc6D3oH nDZf+6Y60EklpaBnilMonjmyIXWpo0hUZHnxUlESlS05ZVeGbTPudZSu18GiMU3IlgL1 iKLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13si1145183pgd.641.2018.02.28.07.38.01; Wed, 28 Feb 2018 07:38:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbeB1Pgt (ORCPT + 99 others); Wed, 28 Feb 2018 10:36:49 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:33248 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752738AbeB1PWe (ORCPT ); Wed, 28 Feb 2018 10:22:34 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yf-0006Xl-Bv; Wed, 28 Feb 2018 15:22:17 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Ye-0008Pa-2I; Wed, 28 Feb 2018 15:22:16 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Mauro Carvalho Chehab" , "Laurent Caumont" , "Sean Young" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 040/254] media: dvb: i2c transfers over usb cannot be done from stack In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Laurent Caumont commit 6d33377f2abbf9f0e561b116dd468d1c3ff36a6a upstream. Signed-off-by: Laurent Caumont Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Ben Hutchings --- drivers/media/usb/dvb-usb/dibusb-common.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) --- a/drivers/media/usb/dvb-usb/dibusb-common.c +++ b/drivers/media/usb/dvb-usb/dibusb-common.c @@ -179,8 +179,20 @@ EXPORT_SYMBOL(dibusb_i2c_algo); int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val) { - u8 wbuf[1] = { offs }; - return dibusb_i2c_msg(d, 0x50, wbuf, 1, val, 1); + u8 *buf; + int rc; + + buf = kmalloc(2, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + buf[0] = offs; + + rc = dibusb_i2c_msg(d, 0x50, &buf[0], 1, &buf[1], 1); + *val = buf[1]; + kfree(buf); + + return rc; } EXPORT_SYMBOL(dibusb_read_eeprom_byte);