Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2668678pxj; Mon, 31 May 2021 07:51:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynxkSbDD/KBYbc9sFkeIF6AFTKCE3vtkeS3N85RM35dssUM461oElAuuWaYWtT9imBC3YN X-Received: by 2002:a05:6402:31a8:: with SMTP id dj8mr3079078edb.296.1622472678786; Mon, 31 May 2021 07:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622472678; cv=none; d=google.com; s=arc-20160816; b=UDUiau48Pzv2+Ce77CE1FZVN2ANKvFl1B8rUT9hLNkB/dDIKr6x/KW3LaQ7R6epiRe eDJg6H3/fxLG8ENKpthziSVZ/ePhEnjxBvUtlUXLbk4uxlqh5uhXFNxSZJeVgYvwAxxX qgpuCbb0HKjZI/T91wT0Yi1u2XvdpnyakAgZCyxc2ZstHR7Ou0TVDcu53dPnlcB1zNqS 4z0zgnbJHBpxr2O6QzJ0ifP69VDYPOtuwdlAcpQWeOVgj9BmOy/jpCMmlNVv4jySnNwp 6O1zeCAud0bTRVK42Jr5KcoV0Lr2Pl//Q282rnhAN2sb6/6qUT2SBBqjuklWzEzc11uK HuHw== 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=ikciepCpzEQl1XlDW+qJ36O04kiGKz5cfVoXakz29kc=; b=BEPJGXIkZL2jv1u9TiltNVj6pJOKtu4TuTvP+RIGJWfIDyr1TPsYdiMHls83WqggcK Hd7298+6eZH7E3t531yj3qo6y1GIZPEdzEPzcWbPEY17twIBKsmbfEm5i9Tqjf07M5RL D5GR8B2SSPte2q6KYdcjepzL/JGSoUYBujDHM5j6pAOyZP3Pf2JuuFT68hOaoQwU5qYq Zgm0cqqw2dbnLggS4wR+xrE9eCExliakTElIxBkHHeFTQquwGLcjN5gB/PGXFH5XjLAp w0C3A41agjxjro2GW0UiwACUeIWxXKFfjKXwMkt7UaB0vOkI4KvpWYWfwxOigZKKSA++ ZJlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QXgw9HqS; 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 f12si10758846ejl.315.2021.05.31.07.50.54; Mon, 31 May 2021 07:51:18 -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=QXgw9HqS; 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 S231652AbhEaOtl (ORCPT + 99 others); Mon, 31 May 2021 10:49:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:36984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232785AbhEaOB3 (ORCPT ); Mon, 31 May 2021 10:01:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC18A61449; Mon, 31 May 2021 13:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468217; bh=HbHEhZjevRB4CeDDwC7R5m9J42CXq3lr/RUWKX8V39w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QXgw9HqSuvEfUr+K75IhyI/bvX+fQd0GjGd6NWtczNpNDBYPziZaVQybVbLbA+gYw LnyJFwDK9rE1PQqpRZpEx+ejEyIRGwhRx6Y3ADM4MawKrBFMbmLiju50dRYlKCX3e3 JVl1BL0EsYRxY+vi/lgC3EJGyfREhuZKKoGvdAeY= 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 5.10 161/252] media: dvb: Add check on sp8870_readreg return Date: Mon, 31 May 2021 15:13:46 +0200 Message-Id: <20210531130703.491589918@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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 ee893a2f2261..9767159aeb9b 100644 --- a/drivers/media/dvb-frontends/sp8870.c +++ b/drivers/media/dvb-frontends/sp8870.c @@ -280,7 +280,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