All of lore.kernel.org
 help / color / mirror / Atom feed
* broken 0 sized memset checks?
@ 2006-09-05 21:05 Dave Jones
  2006-09-05 21:20 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2006-09-05 21:05 UTC (permalink / raw)
  To: linux-sparse

I ran sparse over the current linux kernel, and noticed this..

drivers/net/chelsio/sge.c:341:9: warning: memset with byte count of 0
drivers/net/chelsio/sge.c:469:9: warning: memset with byte count of 0

The first..

        q->size = p->freelQ_size[i];
        ....
        size = sizeof(struct freelQ_ce) * q->size;
        q->centries = kmalloc(size, GFP_KERNEL);
        if (!q->centries)
            goto err_no_mem;
        memset(q->centries, 0, size);

Looks valid enough, as does the second..

        q->size = p->cmdQ_size[i];
        ....
        size = sizeof(struct cmdQ_ce) * q->size;
        q->centries = kmalloc(size, GFP_KERNEL);
        if (!q->centries)
            goto err_no_mem;
        memset(q->centries, 0, size);

Sparse bug ?

	Dave

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-05 21:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-05 21:05 broken 0 sized memset checks? Dave Jones
2006-09-05 21:20 ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.