Commit 21d36495 authored by Tilman Schmidt's avatar Tilman Schmidt Committed by Linus Torvalds

usb_gigaset: don't kmalloc(0)

Zero-sized allocations are pointless anyway, and the SLUB allocator
complains about them, so stop doing that.
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b590d2ba
...@@ -138,8 +138,6 @@ struct usb_cardstate { ...@@ -138,8 +138,6 @@ struct usb_cardstate {
char bchars[6]; /* for request 0x19 */ char bchars[6]; /* for request 0x19 */
}; };
struct usb_bc_state {};
static inline unsigned tiocm_to_gigaset(unsigned state) static inline unsigned tiocm_to_gigaset(unsigned state)
{ {
return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0); return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0);
...@@ -579,25 +577,21 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6]) ...@@ -579,25 +577,21 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
static int gigaset_freebcshw(struct bc_state *bcs) static int gigaset_freebcshw(struct bc_state *bcs)
{ {
if (!bcs->hw.usb) /* unused */
return 0;
//FIXME
kfree(bcs->hw.usb);
return 1; return 1;
} }
/* Initialize the b-channel structure */ /* Initialize the b-channel structure */
static int gigaset_initbcshw(struct bc_state *bcs) static int gigaset_initbcshw(struct bc_state *bcs)
{ {
bcs->hw.usb = kmalloc(sizeof(struct usb_bc_state), GFP_KERNEL); /* unused */
if (!bcs->hw.usb) bcs->hw.usb = NULL;
return 0;
return 1; return 1;
} }
static void gigaset_reinitbcshw(struct bc_state *bcs) static void gigaset_reinitbcshw(struct bc_state *bcs)
{ {
/* nothing to do for M10x */
} }
static void gigaset_freecshw(struct cardstate *cs) static void gigaset_freecshw(struct cardstate *cs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment