Re: NULL dereference BUG in sch56xx_init()

From: Guenter Roeck
Date: Thu Aug 09 2012 - 10:42:33 EST


On Thu, Aug 09, 2012 at 08:55:26PM +0800, Fengguang Wu wrote:
> Hi Guenter,
>
> This commit triggered an oops which can be fixed by the attached diff.
> Should it be folded into the original one (preferable for me), or be
> resent as a standalone patch?
>
I folded it into the original commit.

Thanks a lot for the test and feedback!

Guenter

[ ... ]

> diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c
> index 69abbf7..d00b30a 100644
> --- a/drivers/hwmon/sch56xx-common.c
> +++ b/drivers/hwmon/sch56xx-common.c
> @@ -554,7 +554,7 @@ exit:
> return err;
> }
>
> -static int __init sch56xx_device_add(unsigned short address, const char *name)
> +static int __init sch56xx_device_add(int address, const char *name)
> {
> struct resource res = {
> .start = address,
> @@ -594,7 +594,7 @@ exit_device_put:
>
> static int __init sch56xx_init(void)
> {
> - unsigned short address;
> + int address;
> const char *name = NULL;
>
> address = sch56xx_find(0x4e, &name);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/