From patchwork Fri Jun 19 14:30:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 224079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 211D4C433E1 for ; Fri, 19 Jun 2020 15:20:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E879C20B80 for ; Fri, 19 Jun 2020 15:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580045; bh=hX12khJAdZqJIox8b1e42ktmh3BYm/+28o1Cp2ygp9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KMWcUNIofQkesSDaBw7Nwjc3df7E7oWQASomia/uTwViPihgcbhxx7yRGdjHK22KO s63Nl7VRshMlYmlp0tjnEcnwviB6X2AZcGD3bSBzM670rvrcYxuFuIV37Chutjam8h F0/7GisSw2oOrxLGaj8KZEBlkWOBLSKDBBN+49NE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392741AbgFSPUo (ORCPT ); Fri, 19 Jun 2020 11:20:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:51938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392735AbgFSPUn (ORCPT ); Fri, 19 Jun 2020 11:20:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 68D8A20B80; Fri, 19 Jun 2020 15:20:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580043; bh=hX12khJAdZqJIox8b1e42ktmh3BYm/+28o1Cp2ygp9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0X/6FC2/VRY56IhuoSb6eYEBLq0AWe/m7adPXVVevzs7SB9hzGgQIRoC7R8mwxPdq wh+5Run5jEvCaa7QOWDoI08wfxYloydlG1vIH33l7LScg0JBiQwxEjeOLoUg09TZEM /nGqw+WnEb3W1PGwmlLZdttgOIfUIVJE8DOpuygo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Sean Young , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.7 100/376] media: dvb: return -EREMOTEIO on i2c transfer failure. Date: Fri, 19 Jun 2020 16:30:18 +0200 Message-Id: <20200619141715.082043748@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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)