From patchwork Mon Mar 26 21:10:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10308669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0494B60212 for ; Mon, 26 Mar 2018 21:11:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFBF229611 for ; Mon, 26 Mar 2018 21:11:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D49BA298B8; Mon, 26 Mar 2018 21:11:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8780C29611 for ; Mon, 26 Mar 2018 21:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752082AbeCZVLB (ORCPT ); Mon, 26 Mar 2018 17:11:01 -0400 Received: from osg.samsung.com ([64.30.133.232]:34660 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752048AbeCZVK7 (ORCPT ); Mon, 26 Mar 2018 17:10:59 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 2CB2C332F0; Mon, 26 Mar 2018 14:10:59 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MlUg1rB-YCqj; Mon, 26 Mar 2018 14:10:58 -0700 (PDT) Received: from smtp.s-opensource.com (unknown [179.95.60.72]) by osg.samsung.com (Postfix) with ESMTPSA id 407DD33299; Mon, 26 Mar 2018 14:10:55 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.90_1) (envelope-from ) id 1f0ZOG-00075M-Nu; Mon, 26 Mar 2018 17:10:52 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Alan Cox , Sakari Ailus , Greg Kroah-Hartman , Andy Shevchenko , Hans de Goede , Avraham Shukron , Pierre-Louis Bossart , devel@driverdev.osuosl.org Subject: [PATCH 11/18] media: staging: atomisp: don't access a NULL var Date: Mon, 26 Mar 2018 17:10:44 -0400 Message-Id: <42655bfbf1e40e716e5fa5368bd24737f4e073f2.1522098456.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <8548f74ae86b66d041e7505549453fba9fb9e63d.1522098456.git.mchehab@s-opensource.com> References: <8548f74ae86b66d041e7505549453fba9fb9e63d.1522098456.git.mchehab@s-opensource.com> In-Reply-To: <8548f74ae86b66d041e7505549453fba9fb9e63d.1522098456.git.mchehab@s-opensource.com> References: <8548f74ae86b66d041e7505549453fba9fb9e63d.1522098456.git.mchehab@s-opensource.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Get rid of those warnings: drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:446 gmin_v1p2_ctrl() error: we previously assumed 'gs' could be null (see line 444) drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:480 gmin_v1p8_ctrl() error: we previously assumed 'gs' could be null (see line 478) drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:516 gmin_v2p8_ctrl() error: we previously assumed 'gs' could be null (see line 514) Signed-off-by: Mauro Carvalho Chehab --- .../media/atomisp/platform/intel-mid/atomisp_gmin_platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c index d8b7183db252..be0c5e11e86b 100644 --- a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c @@ -441,7 +441,7 @@ static int gmin_v1p2_ctrl(struct v4l2_subdev *subdev, int on) { struct gmin_subdev *gs = find_gmin_subdev(subdev); - if (gs && gs->v1p2_on == on) + if (!gs || gs->v1p2_on == on) return 0; gs->v1p2_on = on; @@ -475,7 +475,7 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on) } } - if (gs && gs->v1p8_on == on) + if (!gs || gs->v1p8_on == on) return 0; gs->v1p8_on = on; @@ -511,7 +511,7 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on) } } - if (gs && gs->v2p8_on == on) + if (!gs || gs->v2p8_on == on) return 0; gs->v2p8_on = on;