From patchwork Wed Sep 13 07:32:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 9950493 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 0F1C06038F for ; Wed, 13 Sep 2017 07:33:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 017812872C for ; Wed, 13 Sep 2017 07:33:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA619288F1; Wed, 13 Sep 2017 07:32:59 +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.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_SPAM,RCVD_IN_SORBS_WEB autolearn=no 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 A647C289C0 for ; Wed, 13 Sep 2017 07:32:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926AbdIMHcx (ORCPT ); Wed, 13 Sep 2017 03:32:53 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:37187 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751712AbdIMHcq (ORCPT ); Wed, 13 Sep 2017 03:32:46 -0400 Received: by mail-pg0-f68.google.com with SMTP id v5so7285014pgn.4; Wed, 13 Sep 2017 00:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N+QpUEC7d9Qm42j0UfLHliGgHdbmd5i5Dqil+xSrM3E=; b=PimnbwIE0G/rDXiecrSIw6mMZ2dBPCopYVscbUi+DfrFcK950tRZ2Jqgzn9aQJEIPh nhbe8ZMmpdA0jd1yOAfdcMYliTHWqDGKz2OGI+W6PB/MizdPhjRRw2nt6kzNmhfoFyZS aA/XUmFuHtCoKb4mwxiDXWpcQlGYvI4UGqsGdyqFIXkxOrtHC7L/rxlxeOQm70Qw+6LF ZqxRKi0ZuDH2Qw5eqT/vwPi8K4efFOPjMI6cPRhqTcxC+1LJJNZEFamkrJWwyVL1/nFm liImpyFF+Iajuaa35xIMg2MCrLFBTUHU0OgQwgy/dlPrtNcrWIyP1hlIwN3uujGgoaIn jYXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=N+QpUEC7d9Qm42j0UfLHliGgHdbmd5i5Dqil+xSrM3E=; b=n/UhxeBg8l1AYt3WqFL9a29z4ZiE4DYdV1Wd2OIVqmj8nZJr1GLMMcLPWR8lUQqYjD eLI3OQ5qgiQLnFzx/TiJQ5pi/hwfe8GHO6DXwxz4CtbCyUOpxFTTFWgTPqsDOb23MfjG Netyl6J09gg+Ky1+2BJyfXmO4w/2xbyiN1ECyysDnM+QcR1LRuilQDhwDzu5YUF/WG9n 3BYOrL1Kb+ufS93hWyma98X8I3pKdhNDS+54CbLdq6xp2pTRAXMGyBPWlQQ9CqZUWz3m HS1ogGE3rHqjtiosIpQu90LymrOjW4TEQsqmP+aKKgNtnynWRaFzR4CT0ND7acSUXAkD rYWw== X-Gm-Message-State: AHPjjUiHdVBBRL9rTaeuBdFbGcLADO19pD/IGyQM1LIDb96Ti/+MbwKL K1Jx6sKC8BAQwUrd7stw8Q== X-Google-Smtp-Source: ADKCNb7JYjCfwce2n+Eqy1VZFtgxwT5vk4BJv8I3dMUqaev5Yqbr1GBWH0w2aSvrbMsL9LTyP7m94w== X-Received: by 10.99.3.208 with SMTP id 199mr17315337pgd.111.1505287965245; Wed, 13 Sep 2017 00:32:45 -0700 (PDT) Received: from localhost.localdomain ([103.42.74.194]) by smtp.gmail.com with ESMTPSA id u12sm17997328pfg.146.2017.09.13.00.32.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Sep 2017 00:32:44 -0700 (PDT) From: Allen Pais To: linux-kernel@vger.kernel.org Cc: nouveau@lists.freedesktop.org, linux-crypto@vger.kernel.org, dri-devel@lists.freedesktop.org, MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, megaraidlinux.pdl@broadcom.com, target-devel@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-btrfs@vger.kernel.org, Allen Pais Subject: [PATCH 04/10] drivers:mpt: return -ENOMEM on allocation failure. Date: Wed, 13 Sep 2017 13:02:13 +0530 Message-Id: <1505287939-14106-4-git-send-email-allen.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505287939-14106-1-git-send-email-allen.lkml@gmail.com> References: <1505287939-14106-1-git-send-email-allen.lkml@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Allen Pais --- drivers/message/fusion/mptbase.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 84eab28..7920b2b 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -4328,15 +4328,15 @@ initChainBuffers(MPT_ADAPTER *ioc) if (ioc->ReqToChain == NULL) { sz = ioc->req_depth * sizeof(int); mem = kmalloc(sz, GFP_ATOMIC); - if (mem == NULL) - return -1; + if (!mem) + return -ENOMEM; ioc->ReqToChain = (int *) mem; dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ReqToChain alloc @ %p, sz=%d bytes\n", ioc->name, mem, sz)); mem = kmalloc(sz, GFP_ATOMIC); - if (mem == NULL) - return -1; + if (!mem) + return -ENOMEM; ioc->RequestNB = (int *) mem; dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "RequestNB alloc @ %p, sz=%d bytes\n", @@ -4402,8 +4402,8 @@ initChainBuffers(MPT_ADAPTER *ioc) sz = num_chain * sizeof(int); if (ioc->ChainToChain == NULL) { mem = kmalloc(sz, GFP_ATOMIC); - if (mem == NULL) - return -1; + if (!mem) + return -ENOMEM; ioc->ChainToChain = (int *) mem; dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ChainToChain alloc @ %p, sz=%d bytes\n",