Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935206AbcLUPRS (ORCPT ); Wed, 21 Dec 2016 10:17:18 -0500 Received: from alln-iport-1.cisco.com ([173.37.142.88]:13063 "EHLO alln-iport-1.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753017AbcLUPRP (ORCPT ); Wed, 21 Dec 2016 10:17:15 -0500 X-Greylist: delayed 579 seconds by postgrey-1.27 at vger.kernel.org; Wed, 21 Dec 2016 10:17:14 EST X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AVAQC6mVpY/49dJa1dGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBgzUBAQEBAR9agQcHjUmpV4IPggoqhXgCgVw/FAECAQEBAQEBAWI?= =?us-ascii?q?ohGkGOj8QAgEINhAyJQIEAQ0FiGsOqn+LFAEBAQEBAQEBAQEBAQEBAQEBAQEBA?= =?us-ascii?q?RgFhjaEWYMDhx4FiF6HaIoxAYZRimeQUZIyAR83gSqGDHIBh0qBDQEBAQ?= X-IronPort-AV: E=Sophos;i="5.33,384,1477958400"; d="scan'208";a="363892964" From: "Narsimhulu Musini (nmusini)" To: Burak Ok , "linux-kernel@vger.kernel.org" CC: "linux-scsi@vger.kernel.org" , "Martin K Petersen" , James E J Bottomley , "Sesidhar Baddela (sebaddel)" , "Karan Tilak Kumar (kartilak)" , "linux-kernel@i4.cs.fau.de" , Andreas Schaertl Subject: Re: [PATCH] snic: Return error code on memory allocation failure Thread-Topic: [PATCH] snic: Return error code on memory allocation failure Thread-Index: AQHSW5DEdySIShtIPEawnDk0G9nwK6ETQYmA Date: Wed, 21 Dec 2016 15:07:33 +0000 Message-ID: References: <1482327953-4140-1-git-send-email-burak-kernel@bur0k.de> In-Reply-To: <1482327953-4140-1-git-send-email-burak-kernel@bur0k.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.68.223.62] Content-Type: text/plain; charset="us-ascii" Content-ID: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uBLFHQRv009895 Content-Length: 1448 Lines: 53 On 21/12/16 7:15 pm, "Burak Ok" wrote: >If a call to mempool_create_slab_pool() in snic_probe() returns NULL, >return -ENOMEM to indicate failure. mempool_creat_slab_pool() only fails >if >it cannot allocate memory. > >https://bugzilla.kernel.org/show_bug.cgi?id=189061 > >Reported-by: bianpan2010@ruc.edu.cn >Signed-off-by: Burak Ok >Signed-off-by: Andreas Schaertl Acked-by: Narsimhulu Musini >--- > drivers/scsi/snic/snic_main.c | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c >index 396b32d..7cf70aa 100644 >--- a/drivers/scsi/snic/snic_main.c >+++ b/drivers/scsi/snic/snic_main.c >@@ -591,6 +591,7 @@ snic_probe(struct pci_dev *pdev, const struct >pci_device_id *ent) > if (!pool) { > SNIC_HOST_ERR(shost, "dflt sgl pool creation failed\n"); > >+ ret = -ENOMEM; > goto err_free_res; > } > >@@ -601,6 +602,7 @@ snic_probe(struct pci_dev *pdev, const struct >pci_device_id *ent) > if (!pool) { > SNIC_HOST_ERR(shost, "max sgl pool creation failed\n"); > >+ ret = -ENOMEM; > goto err_free_dflt_sgl_pool; > } > >@@ -611,6 +613,7 @@ snic_probe(struct pci_dev *pdev, const struct >pci_device_id *ent) > if (!pool) { > SNIC_HOST_ERR(shost, "snic tmreq info pool creation failed.\n"); > >+ ret = -ENOMEM; > goto err_free_max_sgl_pool; > } > >-- >2.7.4 >