Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2744465pxj; Mon, 31 May 2021 09:38:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTJPUIYpPsz7VNk5OCGv2mBLrHkqcTYMNKTsHhaL048YqYLxKsbcDnrawuyWIh8LzCqOnu X-Received: by 2002:a17:906:80c8:: with SMTP id a8mr7146861ejx.195.1622479122680; Mon, 31 May 2021 09:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622479122; cv=none; d=google.com; s=arc-20160816; b=kPksQjbsgXummaVnXZtu3s+71+24D0MWg92Q3n9wIMtB3e/9Ao60j1kE3L2rGyJsys 3W6ntt3P/UdMXqvXDBRdBRQ9EVoWzXvbA7sSHwnb55Yv8HFoy+gKtbOO5zrlwV8a40up xLuU+d9xMXiuI6ojlKua3R3DpCYTerjPQ3XVAnpNcydYvfU92Dez5FSCSTV/HQ9mLj+R TOasbSoF3WwvJh06+K+HFsMj+Be1LxNovGMaNw6Gm2llh1f+3TpHiS+DD3XDrlM46eqa sGJfZ/dsxHDtM1KujqRnmfrmNObC+sxyph0eXEs7+I8v8AnHXPWCCbNqWnFEd/ry2vX3 FOxg== 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=rxzs8JHotfPHFqms6c4RNo7hEDRhSKz12K1ly/6W/E4GK6n7cLx6Sjat+BEWcjfL2g ql/pVJ5pH870haTNAOH3nS6CPsRDJBX4LcpvSmnQtw6rTq5dPFIaxBcWSJnKsppACwlZ +HBH3AlvBD9y4I01gM/o5aF6EzkOc5tlH3xJyCL8VyAcEo61yfSQstby7c+SYFjNNMwc LmOYOmZYij4NaDqZ0Ql+tjJhO5HI6C+pL4mMWsUKBx3VTqrwfUzhg8N+UO+po/ixosfn j/nO2CizvomGhdPWyTGcMQjqclmJ6IGo6wlDJkC+BzDveFpOiOoh+x9sYwtMrXHD80Ck jfUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="f/Ihyixj"; 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 c10si13463679edv.407.2021.05.31.09.37.58; Mon, 31 May 2021 09:38: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="f/Ihyixj"; 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 S233102AbhEaQgi (ORCPT + 99 others); Mon, 31 May 2021 12:36:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:40316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234016AbhEaOtP (ORCPT ); Mon, 31 May 2021 10:49:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 97D7C61C94; Mon, 31 May 2021 13:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469421; bh=HbHEhZjevRB4CeDDwC7R5m9J42CXq3lr/RUWKX8V39w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f/IhyixjhCgwl4utvglupWnUqz9hqcEBVl4eyvxS85lSxAZIHKO/Zn/ftGP6W5iJt 1qAqCw1ujxJ1qFiZXYsCPzypTUqbUekYxGuwpnzJbH60GfVIGCdfsgE1S4/SGDbTdn JfrXwqSP658CQpnjG5c4jobRdEFW0bN4Mvxzfx0I= 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.12 191/296] media: dvb: Add check on sp8870_readreg return Date: Mon, 31 May 2021 15:14:06 +0200 Message-Id: <20210531130710.295465213@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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