Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp52751ybg; Mon, 8 Jun 2020 16:12:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGcSCAuz9jIxzB+DBgFd4GaYq8Udt/3vROn6DxHLtb9ln93ZbR9ipquqVpZh8gF/dkmxND X-Received: by 2002:a05:6402:1558:: with SMTP id p24mr23646410edx.193.1591657958249; Mon, 08 Jun 2020 16:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591657958; cv=none; d=google.com; s=arc-20160816; b=UhLAkhtf6EDFghH/eDUkpFDra4VX8+Ao9VSDC/QCT9OMiWkUhEcllcwu08niafaF5c 5ro+OCymEq7JusMb/INpCG6YYMVPZNEllZw4QQH9s99OeMVQ6d9OnHvcejB5m6BatADv vDB+G/chhor4PJPe6BjiRY4wHlWOIqivSMK8hRy4Ts/Cu2eYWqlwr0LHUIH+AMPuVGcS 0YIhmFtRkzMkoK5dzrI1WhYNMNPVI7gYSkQMecK8UqRbGKGhW27OqE678ln0NpV7U5YD ZttdbzpYhk+3bHvbvABKuARoUZkDBNSmzlwnruJjQdS8ug5ouEnUyxBcndr75QMF/n1t EhPg== 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=UxtiJH6UTtYvj1gmiBvYO3i4Im0VYgHRPy9ZJ0gP9tM=; b=OGxVzkOsNPde7d3kiyDHBLm2XyuHA12eoEdKZyBX0UEuFgm/5CVFKD4AHs8VnHEOcm 9IcJXsE7Fu0K3WZ58rre4eDlQz7hD7PQNAC8Jnxq5LnPDgnaZtXnhGxa5tGcO8+IBMR/ sNc6Uo+a1fNj677GmLNhLnVFkNHQ9jNm+mMchBaSopv2FdjidYVy3WKqpVOAtcuDCWgj ULaoZ8BeoFeMGHOxiLRJex0XPLKDarrgDtrhuTXeeXAeCsBpcVrPGjdv1s3j2NH9TJWM tb8fPQPQRKXW8xZqwy0/IR4hA5upxcgrzdxHh8LEtIkFJmVbqzr/qut8/B5K/9BN8I01 9uwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ojWFZjvh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si4042086edm.223.2020.06.08.16.12.15; Mon, 08 Jun 2020 16:12:38 -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=ojWFZjvh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728440AbgFHXJf (ORCPT + 99 others); Mon, 8 Jun 2020 19:09:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:53702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728186AbgFHXIc (ORCPT ); Mon, 8 Jun 2020 19:08:32 -0400 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 F041E20890; Mon, 8 Jun 2020 23:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657712; bh=hX12khJAdZqJIox8b1e42ktmh3BYm/+28o1Cp2ygp9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ojWFZjvhPABLZzzWyx0ApvbRDOYPBWYVIqn+q/k15H4l83B+foHy0/33im2D42i9o 0F9Frsi8O1n9aahmt/0GgwpHmEE2ZppfSA6kCXJ1SPHGed8SHPZzDPn4d/fDKMbYkP HYdEwEX5Gc+mNgyq5jDV6ExGtX1G1qBF6R0oqY0Q= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Colin Ian King , Sean Young , Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 108/274] media: dvb: return -EREMOTEIO on i2c transfer failure. Date: Mon, 8 Jun 2020 19:03:21 -0400 Message-Id: <20200608230607.3361041-108-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-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: Colin Ian King [ Upstream commit 96f3a9392799dd0f6472648a7366622ffd0989f3 ] Currently when i2c transfers fail the error return -EREMOTEIO is assigned to err but then later overwritten when the tuner attach call is made. Fix this by returning early with the error return code -EREMOTEIO on i2c transfer failure errors. If the transfer fails, an uninitialized value will be read from b2. Addresses-Coverity: ("Unused value") Fixes: fbfee8684ff2 ("V4L/DVB (5651): Dibusb-mb: convert pll handling to properly use dvb-pll") Signed-off-by: Colin Ian King Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/dvb-usb/dibusb-mb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/dibusb-mb.c b/drivers/media/usb/dvb-usb/dibusb-mb.c index d4ea72bf09c5..5131c8d4c632 100644 --- a/drivers/media/usb/dvb-usb/dibusb-mb.c +++ b/drivers/media/usb/dvb-usb/dibusb-mb.c @@ -81,7 +81,7 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap) if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) { err("tuner i2c write failed."); - ret = -EREMOTEIO; + return -EREMOTEIO; } if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl) -- 2.25.1