aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/slicoss/slicoss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/slicoss/slicoss.c')
-rw-r--r--drivers/staging/slicoss/slicoss.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index f08f4593b186..ee0f0e4e41ad 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -3657,8 +3657,11 @@ static u32 slic_card_locate(struct adapter *adapter)
if (!physcard) {
/* no structure allocated for this physical card yet */
physcard = kzalloc(sizeof(struct physcard), GFP_ATOMIC);
- if (!physcard)
+ if (!physcard) {
+ if (card_hostid == SLIC_HOSTID_DEFAULT)
+ kfree(card);
return -ENOMEM;
+ }
physcard->next = slic_global.phys_card;
slic_global.phys_card = physcard;