From: Dave Jones <davej@redhat.com>
To: linux-sparse@vger.kernel.org
Subject: broken 0 sized memset checks?
Date: Tue, 5 Sep 2006 17:05:12 -0400 [thread overview]
Message-ID: <20060905210512.GF22261@redhat.com> (raw)
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
next reply other threads:[~2006-09-05 20:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-05 21:05 Dave Jones [this message]
2006-09-05 21:20 ` broken 0 sized memset checks? Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060905210512.GF22261@redhat.com \
--to=davej@redhat.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.