Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2706179pxj; Mon, 31 May 2021 08:42:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys977nMerOeM6u1KbRhepsVNSLcDy01Fh1/cg16roPyHkK0BRT/NrPMJ9aL7GectMALwiB X-Received: by 2002:a92:d1c3:: with SMTP id u3mr2624361ilg.190.1622475759958; Mon, 31 May 2021 08:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475759; cv=none; d=google.com; s=arc-20160816; b=mB19D06leiS7DlN1T3HLsWLaRKhkjbrDfkphs1hQu+92eGmLKcW60vkCyyxrTdfd29 1O3GKqys3S5syY2xqY7agbosgis/qxMKl0rAz1ZvEQhO8nabjjHgUyMyZIHuZI7WGgcM V6Dphsxt2NJereyEXwRWGwUEmpT9zxXdclxEXRvLl+KzuCBmpohw0xKg2neN7u1HBCQl hHKcy5gWNutrQZGv6eANrihpMPSqJMU3cPM5OBK3hYFypS+LbFIccA8r7wZ+WY9fJiIR T5d+d6U+ednjLlRbwTs70DNRD5wuHQrFZ8DOnsAHsPAqjYjuKoHlk56HpsgtmN5uO7zx 6kPA== 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=eP7lopMRQi7d5gjv4qPJXKTYtIGdlsZMWxb9F/mBH9+YkiKhjURXEqpQ15HGpL4DiY PXNGNXhLBA44rTAcNL5dm6NonmfYRvs/7adA15p/qxd9uG1+MpytJJM027oZfkugfTkz HSTfTLDpyd18x8Z1kP845DMxM0I5BUk5TByatsgm7DNZM/TjVZ4oxt13rBM2HhibGlME nrRWr2Kd0cpS1PtEAAjWbZn0aRlq5TOzwV2axiVqJBM9pVzJ7QIwuUYMU6kVVbHJeYTK x36jUHd4ICSN2nt5M7hKKoV17iBbr/mcmStoBThSSBAt78iJ6fQdK2v/JN/LpGbdl1nF /PsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bZ42hRUU; 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 a7si14153437jat.120.2021.05.31.08.42.27; Mon, 31 May 2021 08:42:39 -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=bZ42hRUU; 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 S232524AbhEaPmP (ORCPT + 99 others); Mon, 31 May 2021 11:42:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:48832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233672AbhEaOXc (ORCPT ); Mon, 31 May 2021 10:23:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57BC061A0F; Mon, 31 May 2021 13:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468754; bh=HbHEhZjevRB4CeDDwC7R5m9J42CXq3lr/RUWKX8V39w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bZ42hRUUkI6FZQbi14rg7WQud4XYWXFHnBNAA7wkj4ily9SdJyYBA1OcsIWbQCsXJ fnrj1iE85BReIONnIlkeKYzAGeJM7nHzRJpL3FaUKjdIh+K3UJNhx7hZ4gxHsSec8y 2ksor1K/wcFqu++IR8aUkvHY5gFAeYbr2RBn/KL8= 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.4 114/177] media: dvb: Add check on sp8870_readreg return Date: Mon, 31 May 2021 15:14:31 +0200 Message-Id: <20210531130651.854461722@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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