* [Suggestion] drivers/block/aoe: using uninitialized variable.
@ 2013-03-27 7:14 Chen Gang
2013-03-27 14:04 ` Ed Cashin
0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2013-03-27 7:14 UTC (permalink / raw)
To: ecashin; +Cc: linux-kernel@vger.kernel.org
Hello Ed L. Cashin
when compiling with EXTRA_CFLAGS=-W
get the warning:
drivers/block/aoe/aoecmd.c:931:20: warning: ‘bv’ is used uninitialized in this function [-Wuninitialized]
bv is really not initialized.
(and it seems only set "buf->bv_resid = 0" is not enough).
thanks.
gchen.
919 static void
920 bufinit(struct buf *buf, struct request *rq, struct bio *bio)
921 {
922 struct bio_vec *bv;
923
924 memset(buf, 0, sizeof(*buf));
925 buf->rq = rq;
926 buf->bio = bio;
927 buf->resid = bio->bi_size;
928 buf->sector = bio->bi_sector;
929 bio_pageinc(bio);
930 buf->bv = bio_iovec(bio);
931 buf->bv_resid = bv->bv_len;
932 WARN_ON(buf->bv_resid == 0);
933 }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Suggestion] drivers/block/aoe: using uninitialized variable.
2013-03-27 7:14 [Suggestion] drivers/block/aoe: using uninitialized variable Chen Gang
@ 2013-03-27 14:04 ` Ed Cashin
2013-03-28 1:51 ` Chen Gang F T
0 siblings, 1 reply; 3+ messages in thread
From: Ed Cashin @ 2013-03-27 14:04 UTC (permalink / raw)
To: Chen Gang; +Cc: linux-kernel@vger.kernel.org, Jens Axboe
Thanks. Jens Axboe said about it to Dan Carpenter that ...
> It was fixed up yesterday, it was a merge error in the for-next branch.
On Mar 27, 2013, at 3:14 AM, Chen Gang wrote:
> Hello Ed L. Cashin
>
> when compiling with EXTRA_CFLAGS=-W
>
> get the warning:
> drivers/block/aoe/aoecmd.c:931:20: warning: ‘bv’ is used uninitialized in this function [-Wuninitialized]
>
> bv is really not initialized.
> (and it seems only set "buf->bv_resid = 0" is not enough).
>
> thanks.
>
> gchen.
>
> 919 static void
> 920 bufinit(struct buf *buf, struct request *rq, struct bio *bio)
> 921 {
> 922 struct bio_vec *bv;
> 923
> 924 memset(buf, 0, sizeof(*buf));
> 925 buf->rq = rq;
> 926 buf->bio = bio;
> 927 buf->resid = bio->bi_size;
> 928 buf->sector = bio->bi_sector;
> 929 bio_pageinc(bio);
> 930 buf->bv = bio_iovec(bio);
> 931 buf->bv_resid = bv->bv_len;
> 932 WARN_ON(buf->bv_resid == 0);
> 933 }
>
>
--
Ed Cashin
ecashin@coraid.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Suggestion] drivers/block/aoe: using uninitialized variable.
2013-03-27 14:04 ` Ed Cashin
@ 2013-03-28 1:51 ` Chen Gang F T
0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang F T @ 2013-03-28 1:51 UTC (permalink / raw)
To: Ed Cashin; +Cc: Chen Gang, linux-kernel@vger.kernel.org, Jens Axboe
On 2013年03月27日 22:04, Ed Cashin wrote:
> Thanks. Jens Axboe said about it to Dan Carpenter that ...
>
>> > It was fixed up yesterday, it was a merge error in the for-next branch.
thanks.
:-)
--
Chen Gang
Flying Transformer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-28 1:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-27 7:14 [Suggestion] drivers/block/aoe: using uninitialized variable Chen Gang
2013-03-27 14:04 ` Ed Cashin
2013-03-28 1:51 ` Chen Gang F T
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox