Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2624659pxj; Mon, 31 May 2021 06:50:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjCYETR955hoMjsl0uEqZlI4yOel4ZHLYkH/dzplLDsjUPrrJH9hLYU0i8mQhP63WFnTw3 X-Received: by 2002:a5d:8b85:: with SMTP id p5mr16558653iol.43.1622469042305; Mon, 31 May 2021 06:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622469042; cv=none; d=google.com; s=arc-20160816; b=HehRw6cWwhLnPWfenxXozK/jtldXLDCZGeG52kjqTM7QnEthYBCQj14wibZ8jB+QQX VcPigetHfEywMP4dFjCP5Zxz2sl+kx/ibEshcSIMwb9JWXZ4+g6Fn7xmS7Wu17z2OzD3 EA0+SVcHDv+Kr0F8DVtxcW+JiiPAaVhy4BVJU9LIlvkCVFOEv4C4WjnnqpzgZUDeNssc ju12F0GyNz0Y+Tm1lbxp617kaw6cdM22Xh4q1R1/ZJ8cL7zl+SIXLAnHob6sd8xYJpS3 PiFtIDoRkTgpBPE9P8oGbJQLeVfuwkh0m31nDsx/es5k17/MduPgZZwWm6LfvH2OprEQ 5pBw== 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=hNxK8hiI9TBe9U0xZPPGc88S5TQ/1Vlit5CZwMCBHgU=; b=s3zWCbTjP9iJsBfk/EFGFcwbY2NCixDrr+AKD5TfmGb6VoxAMxNid6XfPOZO2ghJFY +li1QO3ZhO+7VM8nD6sapy1PxDOLUBXPCvWePrHt3kq3M1YwfW8nX6KO7bAMSNE2fhqN aGrcjNbiD6hr0bk8NDe+ZgUlJ1KBSNnTSoNTfeEOtRURaDuoaR2lyVmKoO3dlmOXPlNd /WhptZ2Wk9FW1FTYkqmdH2O4uhTwtjJ+z1E5QXqY89tVwNbQ7EUF4wSsLa27O9fOKi2N 6RG3JGcTug6eFP7LsT6O95Aay0Bv54iYxui1roCtQpobuVUDsjhTIBz8SC4UYr9pHuk5 CCPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yOMBNZcl; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si13417906ila.134.2021.05.31.06.50.29; Mon, 31 May 2021 06:50:42 -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=@linuxfoundation.org header.s=korg header.b=yOMBNZcl; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231809AbhEaNtE (ORCPT + 99 others); Mon, 31 May 2021 09:49:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:40214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232708AbhEaNeV (ORCPT ); Mon, 31 May 2021 09:34:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 83396613EE; Mon, 31 May 2021 13:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467489; bh=NVhnBFxxbsod3bZ71tcKvqdmuRUUR+JQxC8nBsemxoY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yOMBNZcleDlUyUMShTXu7y6Tr8O+TTkNrVNKyBhtiNZQQ+dRf7e3plpmM6tkoAXPV Hggp1O33Ur2FqC7T/L9/DsG55hBOsGHxtLaL5wiJqYDM2A/3C8qA7EZ+zN/PUshZS2 N7PEKloboCRcc2Uh7FccxM1EpGHbqJLVanlryNfM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Young , Mauro Carvalho Chehab , Alaa Emad , Sasha Levin Subject: [PATCH 4.19 085/116] media: dvb: Add check on sp8870_readreg return Date: Mon, 31 May 2021 15:14:21 +0200 Message-Id: <20210531130643.030295334@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130640.131924542@linuxfoundation.org> References: <20210531130640.131924542@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: Alaa Emad [ Upstream commit c6d822c56e7fd29e6fa1b1bb91b98f6a1e942b3c ] The function sp8870_readreg returns a negative value when i2c_transfer fails so properly check for this and return the error if it happens. Cc: Sean Young Cc: Mauro Carvalho Chehab Signed-off-by: Alaa Emad Link: https://lore.kernel.org/r/20210503115736.2104747-60-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/media/dvb-frontends/sp8870.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/sp8870.c b/drivers/media/dvb-frontends/sp8870.c index 8d31cf3f4f07..3a577788041d 100644 --- a/drivers/media/dvb-frontends/sp8870.c +++ b/drivers/media/dvb-frontends/sp8870.c @@ -293,7 +293,9 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe) sp8870_writereg(state, 0xc05, reg0xc05); // read status reg in order to clear pending irqs - sp8870_readreg(state, 0x200); + err = sp8870_readreg(state, 0x200); + if (err < 0) + return err; // system controller start sp8870_microcontroller_start(state); -- 2.30.2