Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2699163pxy; Mon, 3 May 2021 06:12:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRYKg/l+b1qnrjIFgXlhMRL32zsxg0ejTRBngpykNCS6ZjXTNySsrMr+enWghJeKgggWrA X-Received: by 2002:a17:902:9f88:b029:ee:b4e5:64d4 with SMTP id g8-20020a1709029f88b02900eeb4e564d4mr12227157plq.41.1620047524059; Mon, 03 May 2021 06:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620047524; cv=none; d=google.com; s=arc-20160816; b=t4g9Z8BqaayB8yvLCrES8YsG1c7nggCiQkcnTV7ECm+uuFXTSCvixc7Moz5k0bkxvQ Y7rxXmo+669nCEX5ZnFMfMq0DU3vTQCI67B1nzcp/wXRdKhIlF1V21o+9dgmgKxKtRSL sJawaOU6FPj6Lei6xJMW0WK88G1zhzzHZp83dYXEKyNhwdzp6Svs98q1hMzrLVVymjsl P0wLhB4qUa1kGHU4iHgIqCbisfvqsYGB7joF5nQkS/Pj2Hhb/NhRBEBy5aOPCYxEAoQ2 haJ1+QpBvuK4n4Pa0BBUfg+ztiUyKKXs07b6Wjp+a/fXaIWtHB9dYmqnWiC6MSZVC7FW 0Uxg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kJh6NMUbPXx4uS+C1DbUB8U6JUTE82e82eHAUoKuHBY=; b=On7nB98vX1mLat0pAbPmT2f2Z+4vKAKnhmpGizXGHXQaob1dfEzY2W8dW7M31sP4RY mW7+bN+7632g01oDJHcPYSxJj8pr1Zpnrl8rZVlKpNjMoP45whtzWr/iMI02F0UgO6Mj lq97AzbYtSZlS4C/Pfm2SDHc96/YGX0C5xupXYNVgs2aSPBneJRXTsj107P+xz3NWydF GvZIrXU2uDKLzPB+UkkCe5TxX0RkB+mFEbJmHymlvFXZsXlsAghV1m5CGf4/Xj4XQyRB wTU4SBFgDvE3V+xnWMhXemTxIc5bgx8Q6oj/VriLgrtPBf0teqUpzPCDGrDIwVDlF8kU S57Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Pr6fJ31e; 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 w2si8042592plg.73.2021.05.03.06.11.50; Mon, 03 May 2021 06:12:04 -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=Pr6fJ31e; 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 S233374AbhECMCw (ORCPT + 99 others); Mon, 3 May 2021 08:02:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:35224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233993AbhECMBv (ORCPT ); Mon, 3 May 2021 08:01:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6F83611CB; Mon, 3 May 2021 12:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620043254; bh=+GCanUseDL/QVpkhm+jfJ9pTIsTAY/+j1/aKY5VyeMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pr6fJ31eq5HKXXtdKzX+1r2eeqMIkpoc/UprY+r9OT8RTFZ1MSbrPvrPs/hnF+fXu 7rx6v+vH3T0QCvclpqHOJdfdsjhTKJst14uqDCf9z7guS/FXMkyxR3zxOfwUvhuMfp 1P9shHncmBLwk8vy8jI5Anpyf21+r1XBwekTRXEk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Alaa Emad , Sean Young , Mauro Carvalho Chehab , Greg Kroah-Hartman Subject: [PATCH 59/69] media: dvb: Add check on sp8870_readreg return Date: Mon, 3 May 2021 13:57:26 +0200 Message-Id: <20210503115736.2104747-60-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210503115736.2104747-1-gregkh@linuxfoundation.org> References: <20210503115736.2104747-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alaa Emad 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 Signed-off-by: Greg Kroah-Hartman --- 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.31.1