lkml.org 
[lkml]   [2017]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/10] driver:megaraid: return -ENOMEM on allocation failure.
Date
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
drivers/scsi/megaraid/megaraid_mbox.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index ec3c438..b09a0a6 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -724,8 +724,8 @@ megaraid_init_mbox(adapter_t *adapter)
* controllers
*/
raid_dev = kzalloc(sizeof(mraid_device_t), GFP_KERNEL);
- if (raid_dev == NULL) return -1;
-
+ if (!raid_dev)
+ return -ENOMEM;

/*
* Attach the adapter soft state to raid device soft state
--
2.7.4
\
 
 \ /
  Last update: 2017-09-13 09:35    [W:0.100 / U:11.720 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site