On Wed, 28 Mar 2007 19:23:32 +0200 (CEST)
Jiri Kosina <jikos@xxxxxxxx> wrote:
blockdev: bd_claim_by_kobject() could check value of unititalized pointer
Fixes this warning:
fs/block_dev.c: In function `bd_claim_by_kobject':
fs/block_dev.c:953: warning: 'found' might be used uninitialized in this function
struct bd_holder *found is initialized only when bd_claim() returns zero. If it returns nonzero, ptr stays uninitialized. Later the value of the pointer is checked.
that generates extra code and people get upset.
One approach which we could ue in here is
struct bd_holder *found = found; /* Suppress bogus gcc warning */
struct bd_holder *found is initialized only when bd_claim() returns zero. If it returns nonzero, ptr stays uninitialized. Later the value of the pointer is checked.