From patchwork Sat Nov 11 19:23:31 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: 10054491 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 142A860632 for ; Sat, 11 Nov 2017 19:24:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED26C297D0 for ; Sat, 11 Nov 2017 19:24:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1D5E29A3B; Sat, 11 Nov 2017 19:24:15 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A7FA297D0 for ; Sat, 11 Nov 2017 19:24:14 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 08D2B2671E8; Sat, 11 Nov 2017 20:24:13 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6EFB02671E9; Sat, 11 Nov 2017 20:24:11 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.14]) by alsa0.perex.cz (Postfix) with ESMTP id B9D6A266B67 for ; Sat, 11 Nov 2017 20:24:09 +0100 (CET) Received: from [192.168.1.3] ([77.181.92.20]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MFL64-1ePkRd0rgq-00EKsi; Sat, 11 Nov 2017 20:23:33 +0100 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Arvind Yadav , Bhumika Goyal , Jaroslav Kysela , Mark Brown , Takashi Iwai References: Message-ID: <249efc55-0688-6772-fc70-526a1bfa2603@users.sourceforge.net> Date: Sat, 11 Nov 2017 20:23:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:T5fb72izvABnWrrK/nx1GG8WlCPPO+SZjLE2+aKoVwNap2pz98u EVDQNRg+hJC5gCZ3ZL8aj5Bl1iOI/WO9g0o085Cyw+k/ksEuMV/clCFqMA7Awls89w34S4P tgSf2QSnR6lwJbgUzVNSvNXCv/ZMBtF6ae0TvEoVZP1Q4jxYXZ/m3aqMMMIgbVKqLfqd3L0 VytkIZv2JPRnrFdusqPVA== X-UI-Out-Filterresults: notjunk:1; V01:K0:VcQ9cfI0338=:Y2Y8u2o5Q5UU3a55Se9z3y +QW8bTgbc1QCqfTfQffIOzHZlrQkmQsv2i/lbl97JrY6w45jyEArNZUU4rw1d35OrLWxdYZXM fsdd8tQd1Ec17QXhq76ca4FDrHAnPPpA5+0pPdc+aH0cgRv+lPRUCR9JyCoWX0pr67LDMGAM+ GayO/j4iLcBR0szRzOkGaRTEoNeGoKr0AP+5CVG3HfsssAmS/Sdu0l/hl47G3g3CiYteOaBxV 0EVK0OlslyVnso/ZhebUoVOJYmXymqp/2bBETRAWh1QYBjZJf9PXSTUJegrxYsbhR3I2nvjk7 u06s29f/KFtsp3zRk9TqaB5SFLjb0R1jmZjsGzaXoVRrg4/m7MUV4MPfdfKwF1oC+WAy/FOJo hYtSoUU6EE0jFLG1yA3/qDZX+EPV8UiEIkE0SsX7yeoTDl9oMSitPze48rYs9QGoheBewRJLQ wnt3U7ekcIKhc3+moJvVU2rnLc7G0aO6HcTGq20Yn8L4hXJrdiYR5sJwbIbfyir/YTE+zoqYt jXb0rqKfKrqPO/qYEKarEAEgmLIuCaC0TKdoeIEM6OW1Cpk1gL2qvUxWSIaGr6iBhcPvrH3Dd coHMzSDLQuDLhZfaR+Hs8pRd/gKsqahBCrVeIAAmMzTiY2yUOpQWfFGy+yt07tsv5Vf3LP4w7 7JPHB34xn3bBjxGMguJa5pNMyiu0CmC4dWCDcaJY3hUKXuMm4i3VYOQLBZozEMdTfqDJD1UXI VrKNJor+NNPUyCPf3lTqbScFUjIPk3aT5JxsEd4Cj/pV+H6WGzhVNpgDxeQyCv6+tsnEqp+R2 00kV4uu7N5nL9mweogfYctkR3G+akd95nazLmKW5jSj+rejABQ= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 3/3] ALSA: sgio2audio: Adjust two null pointer checks in snd_sgio2audio_create() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 11 Nov 2017 20:10:22 +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 --- sound/mips/sgio2audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index 9e175a184b66..4027f0fc8db6 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -841,14 +841,14 @@ static int snd_sgio2audio_create(struct snd_card *card, return -ENOENT; chip = kzalloc(sizeof(*chip), GFP_KERNEL); - if (chip == NULL) + if (!chip) return -ENOMEM; chip->card = card; chip->ring_base = dma_alloc_coherent(NULL, MACEISA_RINGBUFFERS_SIZE, &chip->ring_base_dma, GFP_USER); - if (chip->ring_base == NULL) { + if (!chip->ring_base) { printk(KERN_ERR "sgio2audio: could not allocate ring buffers\n"); kfree(chip);