Skip to content

Commit

Permalink
staging: ozwpan: Remove redundant null check before kfree in ozpd.c
Browse files Browse the repository at this point in the history
kfree on NULL pointer is a no-op.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sachin Kamat authored and Greg Kroah-Hartman committed Nov 21, 2012
1 parent 43f971e commit b150718
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/ozwpan/ozpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f)
f = 0;
}
spin_unlock_bh(&pd->tx_frame_lock);
if (f)
kfree(f);
kfree(f);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
Expand Down Expand Up @@ -737,8 +736,7 @@ int oz_isoc_stream_create(struct oz_pd *pd, u8 ep_num)
st = 0;
}
spin_unlock_bh(&pd->stream_lock);
if (st)
kfree(st);
kfree(st);
return 0;
}
/*------------------------------------------------------------------------------
Expand Down

0 comments on commit b150718

Please sign in to comment.