Re: [PATCH] fix sparse warning in of_device.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Robert Reif <reif@xxxxxxxxxxxxx>
Date: Wed, 28 Mar 2007 19:07:27 -0400

> Fix sparse warning:
> 
> arch/sparc/kernel/of_device.c:439:46: warning: incorrect type in 
> argument 3 (different signedness)
> arch/sparc/kernel/of_device.c:439:46:    expected int *lenp
> arch/sparc/kernel/of_device.c:439:46:    got unsigned int *<noident>
> 
> Signed-off-by: Robert Reif <reif@xxxxxxxxxxxxx>

This patch is not correct.

The loop at the end of this function depends upon the signedness of
'rlen' to handle underflow situations.

With your change to make it unsigned, the loop can possibly not
terminate because if 'rlen' gets decremented below zero it will become
a "very large positive number" instead of a negative one.
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux