Re: [PATCH] x86/hwmon: don't leak device attribute file from pkgtemp_probe()

From: Guenter Roeck
Date: Fri Sep 24 2010 - 01:02:46 EST


Jan Beulich <JBeulich <at> novell.com> writes:
>
> While apparently inherited from coretemp source, this particular error
> handling cleanup path wasn't copied properly (or perhaps got discarded
> intermediately and not re-added properly later).
>
> Signed-off-by: Jan Beulich <jbeulich <at> novell.com>
> Cc: Fenghua Yu <fenghua.yu <at> intel.com>
>
> ---
[...]

> exit_class:
> sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group);
> +exit_dev:
> + device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr);
> exit_free:
> kfree(data);
> exit:
>
The device file should also be deleted in pkgtemp_remove(). Looks like that got
lost as well.

No need to resend; I'll add that myself.

Guenter


--
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/