Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2637272pxj; Mon, 31 May 2021 07:07:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUGx/fPxNmUx0yul3VmxKDk6ImLdRWzdIGpeX9WgqmnZ33nXwFo0EyQoW7KLBXLofd4+3f X-Received: by 2002:a05:6e02:1d82:: with SMTP id h2mr16546474ila.78.1622470023873; Mon, 31 May 2021 07:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622470023; cv=none; d=google.com; s=arc-20160816; b=bCwluzrGxyBQNq02GjTgnzQA1wuhiDFArA5F57LW53ol2L2HnApGsGsJZ7/6QdP8iv a8aUkiWd930bN0yEyLCKnec7wK0CfQMNItuhxERZhkq92tEXNrsYwbwchkbdJzfFBGg3 3w3x1If8zTyXBCQcUvnccaojhflAWB9iLN927Zh9fNW5FBm1QFEPBiv1OONEl8IccMx3 ztp+NppRnHLovKX+kGaqPdMgRhSk7mWlo0R6G1eH084V/oNm99o4MI44RZYMazdlh9uN jpQcmkj5frtWmuNyFYVKl3DwwetEAqXNLb3xK1x8nbAhq0WjZ1tJPeFQD7o/6m6QD2c5 VZaw== 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=+x9FPC90b5Dp9JoDmxfRNon1CVOeve3McN7TBO0DNek=; b=MprtunUH6a1xsdidajOVJA9vtQkbxo+9Lxxn40cSuBuQV1Q335PfqqBgo6uzpQm+4W W8VMRcrI6nzvCfnOrrk9FBF9KmubapOZW7JyNftc3bnMsFiaR4PT9VEhqXLYpiKQXY3S bCZUwZbAvnKKPZ9/YraUoPu/Thwr4ooryiiZ1Db4TgJJxKjf3C4P9jqNFniVggXGLkMF IXMu9Y2CzEbj0f9VNLcYIMBeamCGGTL2wVhfJ3XJ/g/j/sjqZZD+BMTk0lFu5cdyy7ly mv19ZWZx5EEwdhZP470RP8nO90/3qfcgT9zwnaIrxmdlvfcbrDHI4QwY/E3gT2X5tpz8 Hm1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vzvMPQ7f; 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 f2si15864010ioz.41.2021.05.31.07.06.50; Mon, 31 May 2021 07:07:03 -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=vzvMPQ7f; 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 S231898AbhEaOHu (ORCPT + 99 others); Mon, 31 May 2021 10:07:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:49272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232894AbhEaNmo (ORCPT ); Mon, 31 May 2021 09:42:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3CA0861476; Mon, 31 May 2021 13:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467715; bh=xtLMumVgtJEQDYmH/yfxN1UxvNic+puxMIyGP/3wjBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vzvMPQ7fSDTcOwD6hMBKZQPu2eUfNqxxU+A/R/Z/dz7nt5TjXjhQpqu0jJoBapHoU Kgb2jwCzOEp0FU8xQTwzEriUQUtVqV40b/sXDPrmceNI/Rf+PydPf3nsblKtwW3H1X tXM6SPqtkbN9u9X4I0ODvVBCubYIQdYbqA5sVNAQ= 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.14 54/79] media: dvb: Add check on sp8870_readreg return Date: Mon, 31 May 2021 15:14:39 +0200 Message-Id: <20210531130637.731512642@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130636.002722319@linuxfoundation.org> References: <20210531130636.002722319@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 04454cb78467..a5782d1133df 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