From patchwork Mon Sep 4 20:08:38 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: 9937577 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 F033D6035F for ; Mon, 4 Sep 2017 20:09:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E23312040D for ; Mon, 4 Sep 2017 20:09:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D559022299; Mon, 4 Sep 2017 20:09:24 +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 8C5A42040D for ; Mon, 4 Sep 2017 20:09:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754708AbdIDUI4 (ORCPT ); Mon, 4 Sep 2017 16:08:56 -0400 Received: from mout.web.de ([217.72.192.78]:56775 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754601AbdIDUIr (ORCPT ); Mon, 4 Sep 2017 16:08:47 -0400 Received: from [192.168.1.2] ([78.48.84.177]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LZvUH-1d3EOg45yn-00ljMy; Mon, 04 Sep 2017 22:08:40 +0200 Subject: [PATCH 3/6] [media] atmel-isc: Adjust three checks for null pointers From: SF Markus Elfring To: linux-media@vger.kernel.org, Ludovic Desroches , Mauro Carvalho Chehab , Songjun Wu Cc: LKML , kernel-janitors@vger.kernel.org References: <88d0739c-fdc1-9d7d-fe53-b7c2eeed1849@users.sourceforge.net> Message-ID: Date: Mon, 4 Sep 2017 22:08:38 +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: <88d0739c-fdc1-9d7d-fe53-b7c2eeed1849@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:YgPfthYzXaLDwmN9rDdEUctDQ3PCVW9MuQXhJhAVXjR02lCabcP pR2rwdfVf0uVLajTm2+RG0YvK/jWydqCCAMOhY+/AVOKQG2e3dmL1wibHhOk/BvBmkI98ng N47PjWpk8++eFc+D50Kq/2AnmRjcqj76BbKWuQpAKR7Byq5LIpsS9ZOvFLvKrvuG/Qzf3Nd mlxjGss+ws+JiGOEm5u+g== X-UI-Out-Filterresults: notjunk:1; V01:K0:RimUJLzVWN8=:7bLomJi0tAxtyLrDikQM1b d9RyL/2CmHcJk/05WpZtIkgJSUmou/yCJB0UGemy7/DnoQKesAy4glVmpz88L/0DjBI2ZI/p1 yFXLHdKQqFNBwjvfrWMue2Og2d0AQQ4Ol1bJ+F5Sox0CkJ9wa9Cyece89qwd/BrZYQg6u2Fw+ Uk2gRij7kROZPooG+gVY1rzOPcTj16ynbDskkdZAjrpsT5tag3S9F2LId1IuM/L58AIQGsgjL IgCAAngvIeL5VAhgaZEVFmT0qE0TAUwONS81OzivrmR+naC5SvLeWJlMFDNgjh4UR2YZ+dsaD h1cCIhFQuP3+GezMY397Wn5solR2DS5Jc0blhx8vnSy4VRaI28Hx0uqae/5xEQnYItrYFkoph S+qeWlaR4R5pKKWkiiezuNs//HjvLWdmYyU4xponmXJXApjamq8HPIeaNnYZrdrZjyqoAZwEC 10U20Eo0zgwiTsGF2ubNLz+svxRKjNIPnmt7EM73h9lhb00C4lGZcVNM1HabbNEYIe6kj3S8U AOkTyF7ZprVkypPrTGYXbkrAheTfzY+KfrQF2M6rWR5peff88RFO/QdXoWdq1NnoTbHK7wK+I o4dCH83XOH6UBEiWH6oVxCcH8qD/vPOPMfZf/VjJ9NhWKqrwSyfTpFtQT+JHYTiaXdKVOGCy2 B/FpBxzeJgAZE0RpVLsa4O4Nub8K5M5L1hiA+NQegPE86hWWuZxnNbuitVCLK8oXQwtiD8hR8 JUG+LeI1z+RTccjmPxWorMeZ6METmpj6UxZbblqrLYCmWPNI5Y8E/eyFDlhVgqdS/eb54D0bP QuHgMvlUEglBifRvhcNvC8Xw5uRYsnHK/x9pouxjW4H92s4xlg= 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: Mon, 4 Sep 2017 20:54:20 +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/platform/atmel/atmel-isc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index f16bab0105c2..b6048cedb6cc 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -1590,7 +1590,7 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) spin_lock_init(&isc->dma_queue_lock); sd_entity->config = v4l2_subdev_alloc_pad_config(sd_entity->sd); - if (sd_entity->config == NULL) + if (!sd_entity->config) return -ENOMEM; ret = isc_formats_init(isc); @@ -1714,7 +1714,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc) subdev_entity = devm_kzalloc(dev, sizeof(*subdev_entity), GFP_KERNEL); - if (subdev_entity == NULL) { + if (!subdev_entity) { of_node_put(rem); ret = -ENOMEM; break; @@ -1722,7 +1722,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc) subdev_entity->asd = devm_kzalloc(dev, sizeof(*subdev_entity->asd), GFP_KERNEL); - if (subdev_entity->asd == NULL) { + if (!subdev_entity->asd) { of_node_put(rem); ret = -ENOMEM; break;