Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4590603pja; Thu, 21 Nov 2019 22:26:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxX3ALsVNjGbuVnG3IH46XmaNu8EAZPEnr6O0AEw6Ph2XPUDLG1fLGKFUQcy6nwJVdy12wt X-Received: by 2002:a17:906:d9c4:: with SMTP id qk4mr19281456ejb.214.1574403965285; Thu, 21 Nov 2019 22:26:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574403965; cv=none; d=google.com; s=arc-20160816; b=riy9gRUsRY9p2+TE26rPnASm2e0W9zunI6PKZvyFLTr+MKmO9Wntfhw9Cf4jjqIq0O 2v6MqOohpJwAZ5+4TTvM1bvVrIFRsek5voSbASLhdIcXl+nanqUe0Irm9S0vtbdSUDpc orrv7Jyc8dk5wqaJ6ikF7eqsW2Jx4xynuG2yDwrd4vUDTNULDPtS4RraETyn5/M8Lu6n vqDnKzgxEKdzqqrG8o54Y/AhU1iXfngXGprc55Zv/szgAa97dYvM0Dh+XIgsucldD8zp 6knB3zKDGvKkP/r3CiYXq8s2GAHz80EzoR7dtMEx/BThF+grd1gqwKZZPUmuMPphU68Y TFRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=za/5Uzh0QVNUnlnm3jj+6+u8AnMMtWHR4lREM0EhGJc=; b=rcHpVibIHKe/m0Bdwz6klefAitW5Vl/tsbe1nnF4o5p/yqbUsakjrwEFYS60xElFDb BXrfdTJsfauzfExFbjC4Fp9JkMmaTwaHAua57yb3Se0QLEfsSPh5H0mVmCwAK2q1rJOD mnMzU2hVdOGGsuYcAcIzHDB5zsM+5qniSYXhBqdxP2oF/JcQqh6JBcl3rDraxHPUhQva k7Pw1BakwjmMtoTzDZbMPdvTu3taM3GUDbDDxZeWRcaITHJOULx8JK7NDyhWBBGBDuvn 0hmMqi22Hz6SDrAp7w1C55gJbjVM0yC7l1G6odhwvSUZuD432a0bhNi5r2zfioATEWze sbeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zraj3XOC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rv19si3674190ejb.91.2019.11.21.22.25.41; Thu, 21 Nov 2019 22:26:05 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Zraj3XOC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728265AbfKVFvp (ORCPT + 99 others); Fri, 22 Nov 2019 00:51:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:56850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728220AbfKVFvj (ORCPT ); Fri, 22 Nov 2019 00:51:39 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B6C4320731; Fri, 22 Nov 2019 05:51:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401899; bh=W70HprwceHM95eqhp/i6jc2jryBT4sBo1lOQnbLjKaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zraj3XOC9qzcRGFtsXh0a2lU6myxiXPguvCx76JH+RjWie28OV9ZdmaTH+bZG/n0t N0Eclgduj7YxwXdEcyqteTunAKJC6DgA5C5p9rIlvo0Vt8VVFSdmnCi2yDkQgTuEnZ ixuc76009S0J5qbXVZTkGd2KXSSNbwhcrt7rpNf4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kangjie Lu , Mark Brown , Sasha Levin , linux-omap@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 131/219] regulator: tps65910: fix a missing check of return value Date: Fri, 22 Nov 2019 00:47:43 -0500 Message-Id: <20191122054911.1750-124-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kangjie Lu [ Upstream commit cd07e3701fa6a4c68f8493ee1d12caa18d46ec6a ] tps65910_reg_set_bits() may fail. The fix checks if it fails, and if so, returns with its error code. Signed-off-by: Kangjie Lu Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/tps65910-regulator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index 02ccdaa226a73..5ebb6ee73f077 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c @@ -1102,8 +1102,10 @@ static int tps65910_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pmic); /* Give control of all register to control port */ - tps65910_reg_set_bits(pmic->mfd, TPS65910_DEVCTRL, + err = tps65910_reg_set_bits(pmic->mfd, TPS65910_DEVCTRL, DEVCTRL_SR_CTL_I2C_SEL_MASK); + if (err < 0) + return err; switch (tps65910_chip_id(tps65910)) { case TPS65910: -- 2.20.1