From patchwork Fri Sep 1 19:45:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9935223 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 0A3706021C for ; Fri, 1 Sep 2017 19:46:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF60727FAE for ; Fri, 1 Sep 2017 19:46:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E44302818A; Fri, 1 Sep 2017 19:46:16 +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=unavailable 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 8AFED27FAE for ; Fri, 1 Sep 2017 19:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582AbdIATqE (ORCPT ); Fri, 1 Sep 2017 15:46:04 -0400 Received: from mout.web.de ([212.227.15.3]:60324 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbdIATqC (ORCPT ); Fri, 1 Sep 2017 15:46:02 -0400 Received: from [192.168.1.2] ([77.182.57.191]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Md4V8-1e65Ub2POU-00ICkT; Fri, 01 Sep 2017 21:45:51 +0200 Subject: [PATCH 4/4] [media] sp2: Adjust three null pointer checks in sp2_exit() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Olli Salonen Cc: LKML , kernel-janitors@vger.kernel.org References: <6142ca34-fcda-f2b6-bc35-dbbde0d34378@users.sourceforge.net> Message-ID: <2d2b6ac7-eb35-a439-3dab-ed4e01e3a9f8@users.sourceforge.net> Date: Fri, 1 Sep 2017 21:45:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <6142ca34-fcda-f2b6-bc35-dbbde0d34378@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:9U9rgITfBO48uNiBdulRXY1/Zv7HaEyyIILJnZcvpnuZhvlvaLZ mDd3x5D8Q14eXuhiCFnEqGRizwpvbFBe6HaKmtBUQDL3vgZPqA/NOmgo0y5vsnNoZgCvTqC EfYlh2MCYwSg/DmY2kzg6ZjcL8VvdFKcLgg4WCr6j+s26iBLZ56n1NMDY+CqtxHg7toN+Kc ksXaPB60Ov2XJJKUc477A== X-UI-Out-Filterresults: notjunk:1; V01:K0:LdIMTNEv7+0=:7axKvafEmY15TaTiQc6hOL hLYDyMw5lNa8spZHYH61fJvWQ5mHlbsgBfRnFyBic0Ta8By5M92aRRPi9Tso8GqP2XWs5gsBd HyDRUngQCHh2oKFI4b3q5bUzJBnQ8NgSw5J7h71lDv0G97slnoRvDAHLEwm1XIPw35KFt5X74 QagVSObmfJ1X9GqzEdyUAyYAIVpAeEicnxkpZ4Y3ESRWPmNH9VXKrTo3CAmSBcBIUChoRK5hD rKXNDbiCDa/4gZ1D9Yzrz3awAVGn4TUGF+P4iAJNDdMuRAacJAXMr+tiN2640ijoJUeiwskdJ x6NAD6DtRoNz1q8blxVucZxBxBEQyIBDcZRLc1nozyayRDc2fgmSTCIo+98NE6jja6/9xNdOt OzIkBBT4hZ4+U8ojK9LBMhGUORQovdAhpjvQ9QY703lEzONxtUyAL09E8Xd1qU1jELfYE0nV5 sPSvOZihorkBY0jp7aRSpG6sMd/Tt0BjdgHtgg4RcRS6didY8AJK/8uS0weIkJQOxd3zy/Yh0 nm8Kd1I8E5HamX+FLoB3oVt7D7rBsytMxXjtXlk6SnWnIhIvzL22m3TTd0lNXee7xX4COMZuU ObDsHXe83tAyDPABy5alAwVJeHNqJNU10R4CDgkgewvjDQcgK/tvsmn9k8dFopYxb0pKPzCvL Fhxz3+m7LdWsytlsEVjvWCJo07bZjUZyGc9fDJNfYp+hRpoJ3XE/47nAL95tfzjADX5PKhGwc mk3oU9wTOMdZ18WPMuBf9pXueV5nP5Ejeeu1dIGeb28oNrhrP7O/lJMOHFKlKJpMIzcHONT1P w/7ffJMy0qiRly9/Rp23C8bhqV42M4mYpQ6sICuW5S6FpkWAFU= 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 From: Markus Elfring Date: Fri, 1 Sep 2017 21:16:06 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written !… Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/sp2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-frontends/sp2.c b/drivers/media/dvb-frontends/sp2.c index b2a7a54174ae..9bd71ba36d86 100644 --- a/drivers/media/dvb-frontends/sp2.c +++ b/drivers/media/dvb-frontends/sp2.c @@ -357,14 +357,14 @@ static int sp2_exit(struct i2c_client *client) dev_dbg(&client->dev, "\n"); - if (client == NULL) + if (!client) return 0; s = i2c_get_clientdata(client); - if (s == NULL) + if (!s) return 0; - if (s->ca.data == NULL) + if (!s->ca.data) return 0; dvb_ca_en50221_release(&s->ca);