Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3296886pxk; Mon, 21 Sep 2020 09:59:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpX0LcEm5l6EgIdnMnUCXAIo/Y3R37yJnIsajg0JsmPb8v2qHcT91r8Vo9x4pC+05omkaq X-Received: by 2002:a05:6402:cb4:: with SMTP id cn20mr563293edb.369.1600707541753; Mon, 21 Sep 2020 09:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600707541; cv=none; d=google.com; s=arc-20160816; b=x2NFNNCFkyFU9Lg8sr7YLBTOQhYEKiATmxyBDoDPCHITGqt8Y1xWX8nYNfR0Dh9BdP CnN50ugfjOopeWydjPj92FxRq4grz9YPOWOij97z7HlNdPrsQPGmuG8yNwAbnLm9tpFa xN9fBAQt9triezZoxR/+9hcvXHnyB4vHfExNBBsvkUQDbetdy41xxId8wtT5qUGqGQaI d+kAcK517Grp01tsyYBpauu1ZQGdFaBAo8pqazgtfaotX1yQ6zkEoZnfBwY0uadZIqA+ qD8fMsd+RrjrFNChXjkFBbXmDue0G/MKIGyHSmdkSdsNCZY3AWr0fu3OtiFDd4pBknTK GSrg== 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=mGf9kaFqHK/A0yZHmj8aUkHC6CgmVNqwJLVp0oYptg8=; b=c+cxMKlXA/Ko0u+GjwwDajfXv/nLvhqzD/dkukOkLovGsuSAc/VnkEKdh1Wiv38cmk HZlPvGo/M4cJYAJ7+u2i8v37ua4rwdgQtnzcjcintbvdB6EvXpH/n+2OQbwWSlr//GFk gIbAtwOlT2oIdPE00xP6figAyZBs6MGljQ6Rcwj1KCny0Mgl0eQuMvdaGS+qwdBxGyaw Rv0fPmemTs18DRX3V/hBcSVZEQpchnUCwbXaIeIZy1kEuj2Spnmx2exS6+NQ8tu//19e mqokWeJgH0BeBsA+cnV3GiEMjf6WCM1et4W4z9bkmsUgX2IBh20A01IBLUoWh79H6thV Mwsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="J/k+nixu"; 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 re18si8584188ejb.684.2020.09.21.09.58.38; Mon, 21 Sep 2020 09:59:01 -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=@kernel.org header.s=default header.b="J/k+nixu"; 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 S1730129AbgIUQ4e (ORCPT + 99 others); Mon, 21 Sep 2020 12:56:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:49880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729691AbgIUQoi (ORCPT ); Mon, 21 Sep 2020 12:44:38 -0400 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 79FC923976; Mon, 21 Sep 2020 16:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706676; bh=uKhtbAHetKRl79hoPb4Phr9dqJLxsmRtCUHaohCZe5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/k+nixubTxpKMXXLBRSE/+BM8VtfkQ01jl05zYV7MajfLhJR7umK3UpuoyEGpCB7 pRkisHNKKFaZSnAqImrkKOX22aOiINXdJWTyDnm+Xforga6h2Wqe119ho6wD9/5n+p UNcX84397D+BrgC9TDq7Y4tqoyhDqgjNwlyOnaNM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Murphy , Camel Guo , Mark Brown , Sasha Levin Subject: [PATCH 5.8 049/118] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev Date: Mon, 21 Sep 2020 18:27:41 +0200 Message-Id: <20200921162038.597995010@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@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: Camel Guo [ Upstream commit 2569231d71dff82cfd6e82ab3871776f72ec53b6 ] In adcx140_i2c_probe, adcx140->dev is accessed before its initialization. This commit fixes this bug. Fixes: 689c7655b50c ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family") Acked-by: Dan Murphy Signed-off-by: Camel Guo Link: https://lore.kernel.org/r/20200901135736.32036-1-camel.guo@axis.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/tlv320adcx140.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c index 35fe8ee5bce9f..03fb50175d876 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -930,6 +930,8 @@ static int adcx140_i2c_probe(struct i2c_client *i2c, if (!adcx140) return -ENOMEM; + adcx140->dev = &i2c->dev; + adcx140->gpio_reset = devm_gpiod_get_optional(adcx140->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(adcx140->gpio_reset)) @@ -957,7 +959,7 @@ static int adcx140_i2c_probe(struct i2c_client *i2c, ret); return ret; } - adcx140->dev = &i2c->dev; + i2c_set_clientdata(i2c, adcx140); return devm_snd_soc_register_component(&i2c->dev, -- 2.25.1