Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3862337pxb; Tue, 17 Nov 2020 05:39:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYwLEeYK/987GV5hY3f7tiPzlHeRTY4j3w5WmBGUfSxNR0/A2Ray8AMLNdJucfvqVB2ZR9 X-Received: by 2002:aa7:ca41:: with SMTP id j1mr21153938edt.295.1605620361407; Tue, 17 Nov 2020 05:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620361; cv=none; d=google.com; s=arc-20160816; b=AHs+lmn5/BaeEfTYYYF5VdMSWIZSS4l6RT+FdKy68Ija3tEePB4J4txJJGMR67MXbk AwMBGo+gcxp0v1MpagSJQUbMhLn0jjzCkP/j0i0fxJlFFNv0Yw0ok40P9JYFw0TbtXhX 59eyXilikBtdpPULkwHAufi4hvOhEjpkda52qmaX54frIFQyRrJ5++ip/KBEi5J/fRf0 rOSko7vP/NdHkgIWmZZIPioYN0vyC0UneQLm0RA2ffTBeSII0OMhxoFceslKIgcttKBZ f20UNTYbL9QLdFsTRHI0xViDAQEVbuSzimZnCSRdq7xzyoRffXwqskKMoYIi+f4w9G/o Grjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NsYsBRn1Vqqhn0cycz59A10vUK1D3apAz21448sOpxk=; b=qf2wypHQbTpe0vMNZTgPVTK/gYFNFh6QGHD6b/cMK/Oq/n4g0LJJx4YpFbTPHLuZXX //71r6jKRp83ALA32QES+qzggpGTu0ysg1EemXxpMZL4y4pvzEt4AgZbRkQuvTEgu3Xi M2UPvg2/N7q9zDWRZ4ggpA9tSSM3NFxoqnntdysDU9iobT+msdTuc22vSj78fOLHXpco 1eUkH8kOsEqOdTVFHv1JRRsXpp0WYnzYqMsqAeQdJkv1WxUdWf4dUsnMwiEZAVhXuiwn X3+7CwD5NRljJKARXhK105DzWMfNOh32X9uhNbLKXNodLuHYsNc48Gc1kerkblOVZUY8 LcEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s4WL+wbL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si12949037ejp.590.2020.11.17.05.38.58; Tue, 17 Nov 2020 05:39:21 -0800 (PST) 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=@kernel.org header.s=default header.b=s4WL+wbL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732599AbgKQNg3 (ORCPT + 99 others); Tue, 17 Nov 2020 08:36:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:47334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732576AbgKQNgW (ORCPT ); Tue, 17 Nov 2020 08:36:22 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B8A720780; Tue, 17 Nov 2020 13:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620182; bh=ZQOU+KaXU427X6FDYgvER0NThEXdA4kIOuopGtcHNEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s4WL+wbLkwph7+zt5svUNiAF300CVtqyoMPcm/i9AIeiF89kJpE2vvUsuYtjLyUDG ctP5DKmEy234Zoy5NcsaeCTs55u/iiZtG/TTIXXp5Vl/YgZoe5DaOIVjMUOKCsHb54 B1pJZkwOCKvrvynwID6gp9rRWTvkPoP7rWRUwzIQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= , Andy Shevchenko , =?UTF-8?q?Jan=20Kundr=C3=A1t?= , Linus Walleij , Sasha Levin Subject: [PATCH 5.9 134/255] pinctrl: mcp23s08: Use full chunk of memory for regmap configuration Date: Tue, 17 Nov 2020 14:04:34 +0100 Message-Id: <20201117122145.460890570@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit 2b12c13637134897ba320bd8906a8d918ee7069b ] It appears that simplification of mcp23s08_spi_regmap_init() made a regression due to wrong size calculation for dev_kmemdup() call. It misses the fact that config variable is already a pointer, thus the sizeof() calculation is wrong and only 4 or 8 bytes were copied. Fix the parameters to devm_kmemdup() to copy a full chunk of memory. Fixes: 0874758ecb2b ("pinctrl: mcp23s08: Refactor mcp23s08_spi_regmap_init()") Reported-by: Martin Hundebøll Signed-off-by: Andy Shevchenko Tested-by: Martin Hundebøll Link: https://lore.kernel.org/r/20201009180856.4738-1-andriy.shevchenko@linux.intel.com Tested-by: Jan Kundrát Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-mcp23s08_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-mcp23s08_spi.c b/drivers/pinctrl/pinctrl-mcp23s08_spi.c index 1f47a661b0a79..7c72cffe14127 100644 --- a/drivers/pinctrl/pinctrl-mcp23s08_spi.c +++ b/drivers/pinctrl/pinctrl-mcp23s08_spi.c @@ -119,7 +119,7 @@ static int mcp23s08_spi_regmap_init(struct mcp23s08 *mcp, struct device *dev, return -EINVAL; } - copy = devm_kmemdup(dev, &config, sizeof(config), GFP_KERNEL); + copy = devm_kmemdup(dev, config, sizeof(*config), GFP_KERNEL); if (!copy) return -ENOMEM; -- 2.27.0