Skip to content

Commit

Permalink
Staging: bcm: Return -ENOMEM instead of -1 when memory not acquired i…
Browse files Browse the repository at this point in the history
…n 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>
  • Loading branch information
Kevin McKinney authored and Greg Kroah-Hartman committed Jun 12, 2012
1 parent 6788d7d commit 7dd80eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/bcm/nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ INT PropagateCalParamsFromEEPROMToMemory(struct bcm_mini_adapter *Adapter)
INT Status = 0;

if (pBuff == NULL)
return -1;
return -ENOMEM;

if (0 != BeceemEEPROMBulkRead(Adapter, &uiEepromSize, EEPROM_SIZE_OFFSET, 4)) {
kfree(pBuff);
Expand Down Expand Up @@ -1462,7 +1462,7 @@ INT PropagateCalParamsFromFlashToMemory(struct bcm_mini_adapter *Adapter)

pBuff = kmalloc(uiEepromSize, GFP_KERNEL);
if (pBuff == NULL)
return -1;
return -ENOMEM;

if (0 != BeceemNVMRead(Adapter, (PUINT)pBuff, uiCalStartAddr, uiEepromSize)) {
kfree(pBuff);
Expand Down

0 comments on commit 7dd80eb

Please sign in to comment.