Skip to content

Commit

Permalink
usb_gigaset: don't kmalloc(0)
Browse files Browse the repository at this point in the history
Zero-sized allocations are pointless anyway, and the SLUB allocator
complains about them, so stop doing that.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Hansjoerg Lipp <hjlipp@web.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Tilman Schmidt authored and Linus Torvalds committed May 9, 2007
1 parent b590d2b commit 21d3649
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/isdn/gigaset/usb-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ struct usb_cardstate {
char bchars[6]; /* for request 0x19 */
};

struct usb_bc_state {};

static inline unsigned tiocm_to_gigaset(unsigned state)
{
return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0);
Expand Down Expand Up @@ -579,25 +577,21 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])

static int gigaset_freebcshw(struct bc_state *bcs)
{
if (!bcs->hw.usb)
return 0;
//FIXME
kfree(bcs->hw.usb);
/* unused */
return 1;
}

/* Initialize the b-channel structure */
static int gigaset_initbcshw(struct bc_state *bcs)
{
bcs->hw.usb = kmalloc(sizeof(struct usb_bc_state), GFP_KERNEL);
if (!bcs->hw.usb)
return 0;

/* unused */
bcs->hw.usb = NULL;
return 1;
}

static void gigaset_reinitbcshw(struct bc_state *bcs)
{
/* nothing to do for M10x */
}

static void gigaset_freecshw(struct cardstate *cs)
Expand Down

0 comments on commit 21d3649

Please sign in to comment.