Skip to content

Commit

Permalink
staging: vt6655: s/kmalloc + memset/kzalloc in alloc_rd_info
Browse files Browse the repository at this point in the history
replace kmalloc and memset if the pointer is valid with kzalloc,
and remove the check around the null pointer cases as we dont need it.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Devendra Naga authored and Greg Kroah-Hartman committed Jan 17, 2013
1 parent 4bbc0bc commit b5b384b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/staging/vt6655/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -882,14 +882,7 @@ inline static bool device_get_ip(PSDevice pInfo) {


static inline PDEVICE_RD_INFO alloc_rd_info(void) {
PDEVICE_RD_INFO ptr;
ptr = (PDEVICE_RD_INFO)kmalloc((int)sizeof(DEVICE_RD_INFO), (int)GFP_ATOMIC);
if (ptr == NULL)
return NULL;
else {
memset(ptr,0,sizeof(DEVICE_RD_INFO));
return ptr;
}
return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC);
}

static inline PDEVICE_TD_INFO alloc_td_info(void) {
Expand Down

0 comments on commit b5b384b

Please sign in to comment.