Received: by 10.223.185.116 with SMTP id b49csp3974332wrg; Tue, 13 Feb 2018 10:37:19 -0800 (PST) X-Google-Smtp-Source: AH8x225ArHdvVxwComoKxOVfbKulAKKpp7AfS7lSRwSq/QAiudJmM8gEFaD88qusb83lgpGi39IR X-Received: by 10.98.75.206 with SMTP id d75mr2149442pfj.77.1518547039518; Tue, 13 Feb 2018 10:37:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518547039; cv=none; d=google.com; s=arc-20160816; b=rAVKMVQTrHVh1L8ND/Fz97F4qgZ49eW65ZuBYRwRbYBXZLrWmC6n3UKq1FwujvnUBj g9WpeMx3yLfPTPHjWasuCnhdcnNky5+wg86rUyEUZRfhhWY4XII8fW7ehjk2kvBgmq28 p6TafGq9MZ1qttgiDSmPYn1XTXhNGnlzIOI5vxbzR6/Q2Gs+uuuoQdurg49YDJMwmgi/ wVKa+HMASVPUcSPHfEK2R+vuJW+14aXW5d+8aTdkQTi233ct3f3z40mVaFb3X8EHkDAt BKP+UBEnL5SKC+vlzxNP/gV96pHpczWinnojfJe4vMiWQJ4yrKEgfAFvshm2l78rbWd3 TU5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=YEPg+Mc5oM6PUl6LttbrAEMd/Cxnc+cD862ldzDFe0A=; b=To4Mksm786uHVuDJnSo5fxsDRsK2OuVEceweKh406zALNo49vreDIxTlsjUSAAcvOP rG1azEpC+P3pgRewZm+159cDezrvEmGXW5KxiBmYUnwkByDQzqzkGG/ZYAZGkwPSgFhC Q6KShQoQCgajV9XHqlwMYJSRDoyxQMnVH3vroqkdbZmrn6LnoXNjW/y+M0EI+eYUgLKD oNBNinWuVrExOfNnTBkvfOSRUOSKaDYSLkBwTfWgcg3WeA78K5PqNaOrgPi/E1BJffB2 yojFVPxRH4NsrS9H8HjWr5UDNVShkbDENIXJcIYFEOBILgjvmQPTxIVqB7IQsMUeikfP 8hrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si1472939pgq.683.2018.02.13.10.37.04; Tue, 13 Feb 2018 10:37:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965574AbeBMSfC (ORCPT + 99 others); Tue, 13 Feb 2018 13:35:02 -0500 Received: from mout.web.de ([212.227.17.11]:58809 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965399AbeBMSfA (ORCPT ); Tue, 13 Feb 2018 13:35:00 -0500 Received: from [192.168.1.2] ([78.49.42.52]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MCZtW-1etscx2auI-009Qb3; Tue, 13 Feb 2018 19:34:53 +0100 Subject: [PATCH 2/2] firewire: nosy: Adjust eight checks for null pointers From: SF Markus Elfring To: linux1394-devel@lists.sourceforge.net, Stefan Richter Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Tue, 13 Feb 2018 19:34:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:8a1ohThRSdqHjPrnrtYTyWobNxENel9PYV32d6/aDJsFxJJcTzq 5ZCCSMGyrg1JCLHwr/FZs814ecai0xNusFIrU9hKaYrb/ilT1coA2t9VsFZpCKEyDWU3SU/ Ux0BYe5NmWsl4y1Oa2hsDCCyk5yACMWj+12gtWiGBwR745wEUKOvtqKMbLeS1U/8yTyZXnA 37WYx93hYu10hXWNDbO5Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:JbeOOBUJc+Q=:1AAHmviIfUy4lKfwXporu1 f6bpEGmCpeoouNtbG9jDZ2YejH27YHm4zpbkbZecq2+RhsWMrkkIE8aWtiJNxoLhb1QeAeLMU t4JVyCg1hSNQy7E6VVUI/ZhyTdMHiAN0QqUX77qX+lnaUMuP5ny/VwvTd2OoMlKZMRiAy+7VX LkQUuZX2N0DwCkPYa7pphu4pPg2oMiRF9t3PycLmr6jK+oQ05cExRt7+QaORFI4onv2fBQeM/ DuNneoIGxNXD6/YYU53MSetv3SaLc+7l1cCULRojYJWJiaYWFeTX4BTYnTtAQEloD9xLiAujG CGK45EIyad9ciprH9dbNPvuTAsevuZVe5JMftiAR2cdl+iNR9KDH3px5QCMWk6et5Gm9q4hLs SGVHDwxSJE5YXUwtQpEjTBMp9gSpouQS4ILkHV3O/u4rr5ARXxw8Vyky+RnmQstnVpZKgZ9tn BL+X05aSctZdlANi6JkiOkTNa/I+z/U1cmM18pQ/5ekWOHb4QT/IM2jGTo16/lwgaLFLYdy84 wf4kabCFTCr73w/MxecWVZN8MiZky/9RSPmb9RghnYDiAkpqfuQdWhR7HC9GVevMLDhavOidL dVk8eOE/+cbpeELEc9HKN9Kem7igH2dDwAsk6hkN0sb+8UdB3wed+csAGmctqt7kU55sjee/7 drtiIVfMrhTMkGBmOnos9SgfaZv9cyYPIo7/giaiLsYhx7PxdjYPAaiOPscnciD+4Xa5Qs756 XfNATzAoAsYf6szPANChjGx4/HYOcA40a6uHTSCcGCo9NCTTv/gQPp+Ar5VD5ggIarcN2R4OO nOCYlMBSBiE5N6jZnPgGRJ3TQSDr+Fdv1GnHxUwoo6hNA45pHw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Tue, 13 Feb 2018 19:20:26 +0100 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/firewire/nosy.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c index 6192f0718bf2..0eaf79c625c6 100644 --- a/drivers/firewire/nosy.c +++ b/drivers/firewire/nosy.c @@ -128,7 +128,7 @@ static int packet_buffer_init(struct packet_buffer *buffer, size_t capacity) { buffer->data = kmalloc(capacity, GFP_KERNEL); - if (buffer->data == NULL) + if (!buffer->data) return -ENOMEM; buffer->head = (struct packet *) buffer->data; buffer->tail = (struct packet *) buffer->data; @@ -287,11 +287,11 @@ nosy_open(struct inode *inode, struct file *file) break; } mutex_unlock(&card_mutex); - if (lynx == NULL) + if (!lynx) return -ENODEV; client = kmalloc(sizeof *client, GFP_KERNEL); - if (client == NULL) + if (!client) goto fail; client->tcode_mask = ~0; @@ -552,7 +552,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) pci_set_master(dev); lynx = kzalloc(sizeof *lynx, GFP_KERNEL); - if (lynx == NULL) { + if (!lynx) { ret = -ENOMEM; goto fail_disable; } @@ -565,7 +565,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) lynx->registers = ioremap_nocache(pci_resource_start(dev, 0), PCILYNX_MAX_REGISTER); - if (lynx->registers == NULL) { + if (!lynx->registers) { dev_err(&dev->dev, "Failed to map registers\n"); ret = -ENOMEM; goto fail_deallocate_lynx; @@ -577,9 +577,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) sizeof(struct pcl), &lynx->rcv_pcl_bus); lynx->rcv_buffer = pci_alloc_consistent(lynx->pci_device, RCV_BUFFER_SIZE, &lynx->rcv_buffer_bus); - if (lynx->rcv_start_pcl == NULL || - lynx->rcv_pcl == NULL || - lynx->rcv_buffer == NULL) { + if (!lynx->rcv_start_pcl || !lynx->rcv_pcl || !lynx->rcv_buffer) { dev_err(&dev->dev, "Failed to allocate receive buffer\n"); ret = -ENOMEM; goto fail_deallocate_buffers; -- 2.16.1