[PATCH V2 11/16] staging: wilc1000: host_int_init: fix kzalloc error check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes error check when kzalloc is failed.
NULL comparison style is changed to use ! operator and
PRINT_ER is also removed.

Signed-off-by: Chaehyun Lim <chaehyun.lim@xxxxxxxxx>
---
v2: rebase latest staging-testing

 drivers/staging/wilc1000/host_interface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 8c0c478..2150c89 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6372,9 +6372,8 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
 
 	/*Allocate host interface private structure*/
 	pstrWFIDrv  = kzalloc(sizeof(tstrWILC_WFIDrv), GFP_KERNEL);
-	if (pstrWFIDrv == NULL) {
+	if (!pstrWFIDrv) {
 		s32Error = -ENOMEM;
-		PRINT_ER("Failed to allocate memory\n");
 		goto _fail_timer_2;
 	}
 	*phWFIDrv = pstrWFIDrv;
-- 
2.5.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux