Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1316382pxb; Thu, 7 Oct 2021 05:30:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuvB2Galwydv9Jgn61VOWizRhK2i1egRtXqJQz2iE6MVNBoIQy49cri/bUDFgdgQlu/wYk X-Received: by 2002:a62:b50d:0:b0:44c:7488:e593 with SMTP id y13-20020a62b50d000000b0044c7488e593mr4050969pfe.59.1633609824176; Thu, 07 Oct 2021 05:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633609824; cv=none; d=google.com; s=arc-20160816; b=CtHBdjqj7JtGvac9BLw/rv8HRC/FCwYSK12FX23gt3MT/9ciic1UFbxlAIT+mMEA4j ycCqt/8+s2ew5CkmxUXGuGvcR2YR7EDhX0atv7PJTLKQgpXCEOAHaszcgseKS6wjivCm dVUAU+zARFrL1bFIeUjNvBoGx2/VNZV/b0Q2xyJeerZhacvj+QQ6mPiDEFXa96xZFZwb Wl2pCdjpA9HHC+bNEmyHN/J3ToGeTiGC/naE5IcnpJbIj0hOPHaAaSMWkl/F5zuP1lKa a8RwhbsEw0DmTKCRwQXTZfU1bkEyQA0KsBmpVTegM+7D+jhfDG0XwZ7HeWOfhJSFcgfA n6dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :mime-version:user-agent:date:message-id:cc:to:subject:from :dkim-signature:dkim-signature:dkim-signature; bh=XFUZIvYUUSzvXFg3UTtTaUX58u2hmAWVTWHRchR63XM=; b=mvNJDzqU36ZsG8PbSbu9Ox1hsikDsuvNW5BP9vwSY5OP2xm2TD8LTSgtrCt1Vl9dM1 0xZjt5gUGr97u8R3ts4InwVi4FGPtV5kSPJy2PCnRwBoS4NfYAtMSuVDLl+7W4+Sb96D wyxE/DLqkpL0a7WNQiIprg6LlxyNQJjm2TS71AigNb4ScQdVY8pBXtIWWWY/PVSziliq ODo/IGjmhjdNx7XibYfOZTjwSSJsfLOxi2omadmRfguXjOhujGhwOgNTWVqjBeaPs0+j bfynGXxCDtjeGlqPFqcI7GcXUeso5Hfq1CFDrJ6/E9yFia+SU7AtBokyH14DWne7Xkde T68g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mida.se header.s=20191106 header.b=Wq9ycX1o; dkim=pass header.i=@mida.se header.s=rsa1 header.b=PFdaGnuZ; dkim=neutral (no key) header.i=@mida.se header.s=ed1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si32564295plq.218.2021.10.07.05.30.09; Thu, 07 Oct 2021 05:30:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mida.se header.s=20191106 header.b=Wq9ycX1o; dkim=pass header.i=@mida.se header.s=rsa1 header.b=PFdaGnuZ; dkim=neutral (no key) header.i=@mida.se header.s=ed1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241383AbhJGMa5 (ORCPT + 99 others); Thu, 7 Oct 2021 08:30:57 -0400 Received: from mailrelay2-3.pub.mailoutpod1-cph3.one.com ([46.30.212.11]:52874 "EHLO mailrelay2-3.pub.mailoutpod1-cph3.one.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241377AbhJGMa5 (ORCPT ); Thu, 7 Oct 2021 08:30:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mida.se; s=20191106; h=content-transfer-encoding:content-type:mime-version:date:message-id:cc:to: subject:from:from; bh=XFUZIvYUUSzvXFg3UTtTaUX58u2hmAWVTWHRchR63XM=; b=Wq9ycX1o2L1kxKolvttKlXMfccIHzb+8QG96A7B6C1BpiQUivoDrbplBYEce7GRRqW3Z/ezF4yI6V q+xWtGKt98nrPi70KWFWNO6i8kgz7FxIAO6npTcslm0DRXH0wd1INl3ZXaH3dLEJGh0RfuCw2In2y8 1jLGfgd6ot/btSAUw7H+IiJxlA8pl5K+H65VGev7flzmj15V7REB4EP8kU53ABaKN1B3pLsmQDUXc2 /QOAGlg3ju3YKLnwrkkaXwPvbMZW8gF4aeMdj2S+tg2kru4S7ZzsTSd+21PUANbFzaTBCtOwz74MaJ Gq0svZahDVg275WNpPK7ealai+YxU/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mida.se; s=rsa1; h=content-transfer-encoding:content-type:mime-version:date:message-id:cc:to: subject:from:from; bh=XFUZIvYUUSzvXFg3UTtTaUX58u2hmAWVTWHRchR63XM=; b=PFdaGnuZ9nB+A3DVbgseRL7xf2KnlS2waAvrrEhfmHsIuO6XUCAYmYrL6+1Xj6mFXwMkbNheDUrgg LmjS/ilhSTF/wQaPF06c9RXF+XwJXABDRwrARTeUjjaMmrycGZhhu66vpEoNcYeOkfROi+09hNsmpz 0+B79nKMPKFe+80y4IORchKefsszRkEpak/myaT3Z8FYYkE1dY/yUqK5qHGhrqvYJW+deAzBHFBRcf 77xMPosMNZ+y/6SmgTmzYpmpzLjFbHShTbfUGpGOkm0o4HWsZCeauppcEKlC2ZZEQEL1Lp/Lf23imP lb2+IxRdBya8TRG9iX9cgmgqVRNV59w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=mida.se; s=ed1; h=content-transfer-encoding:content-type:mime-version:date:message-id:cc:to: subject:from:from; bh=XFUZIvYUUSzvXFg3UTtTaUX58u2hmAWVTWHRchR63XM=; b=rQ3I1S8+M3z6sUPSIRi1zQ2f+hAAWLvFqBm4OUeenRUNj6M9ydGhHtnq1xQ5S02Xs0t68tK7hd95m EGHcLRaAw== X-HalOne-Cookie: 337e692878d51df8326ce4c9460df03be9965480 X-HalOne-ID: 269d6e5d-276a-11ec-bd57-d0431ea8a290 Received: from [192.168.1.108] (2.67.139.77.mobile.tre.se [2.67.139.77]) by mailrelay2.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 269d6e5d-276a-11ec-bd57-d0431ea8a290; Thu, 07 Oct 2021 12:29:01 +0000 (UTC) From: rkardell Subject: [PATCH] media: dvb: qt1010, change i2c read buffer from stack, to kernel space To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Message-ID: Date: Thu, 7 Oct 2021 14:29:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: sv-FI Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Solve problem with initialization of Mega Sky 580 USB DVB (and other using mt352), error when reading i2c id. Signed-off-by: rkl099 --- ?drivers/media/tuners/qt1010.c | 6 +++++- ?1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/tuners/qt1010.c b/drivers/media/tuners/qt1010.c index 3853a3d43..1bc0756f7 100644 --- a/drivers/media/tuners/qt1010.c +++ b/drivers/media/tuners/qt1010.c @@ -11,18 +11,22 @@ ?/* read single register */ ?static int qt1010_readreg(struct qt1010_priv *priv, u8 reg, u8 *val) ?{ +??? u8 *b1=kmalloc(1,GFP_KERNEL); ??????? struct i2c_msg msg[2] = { ??????????????? { .addr = priv->cfg->i2c_address, ????????????????? .flags = 0, .buf = ®, .len = 1 }, ??????????????? { .addr = priv->cfg->i2c_address, -???????????????? .flags = I2C_M_RD, .buf = val, .len = 1 }, +???????????????? .flags = I2C_M_RD, .buf = b1, .len = 1 }, ??????? }; ??????? if (i2c_transfer(priv->i2c, msg, 2) != 2) { ??????????????? dev_warn(&priv->i2c->dev, "%s: i2c rd failed reg=%02x\n", ??????????????????????????????? KBUILD_MODNAME, reg); +?????????? kfree(b1); ??????????????? return -EREMOTEIO; ??????? } +?????? *val=b1[0]; +?????? kfree(b1); ??????? return 0; ?} -- 2.30.2