Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: bcm: Return -ENOMEM instead of -1 when memory not acquired in nmv.c

This patch changes the return statement on two
conditions where memory could not be acquired.
It returns -ENOMEM instead of -1.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kevin McKinney and committed by
Greg Kroah-Hartman
7dd80eb9 6788d7da

+2 -2
+2 -2
drivers/staging/bcm/nvm.c
··· 1378 1378 INT Status = 0; 1379 1379 1380 1380 if (pBuff == NULL) 1381 - return -1; 1381 + return -ENOMEM; 1382 1382 1383 1383 if (0 != BeceemEEPROMBulkRead(Adapter, &uiEepromSize, EEPROM_SIZE_OFFSET, 4)) { 1384 1384 kfree(pBuff); ··· 1462 1462 1463 1463 pBuff = kmalloc(uiEepromSize, GFP_KERNEL); 1464 1464 if (pBuff == NULL) 1465 - return -1; 1465 + return -ENOMEM; 1466 1466 1467 1467 if (0 != BeceemNVMRead(Adapter, (PUINT)pBuff, uiCalStartAddr, uiEepromSize)) { 1468 1468 kfree(pBuff);