Re: [PATCH 2/2] hwmon: (w83627ehf) Fix memory leak in probe function

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

 



On Mon, 12 Mar 2012 18:20:13 +0000, Mark Brown wrote:
> On Mon, Mar 12, 2012 at 11:04:50AM -0700, Guenter Roeck wrote:
> 
> > The only thing I don't know for sure is if platform_set_drvdata(pdev,
> > NULL); is still needed. It doesn't hurt, though, so I don't remove it.

I checked if the devm infrastructure was doing it but it appears it
doesn't, which is why I didn't object to keeping it.

In the i2c subsystem, we have moved this to i2c-core itself, and I
would tend to think every subsystem should do the same. Or even the
driver core...

> Any driver relying on it has always been buggy, anything might happen to
> the value while the driver isn't bound.  I keep thinking we should have
> a debugging option to write random data there for unbound devices just
> in case.

Writing a random value isn't going to help you spot anything. If
anything, you'd have to write a well-defined poison value so that you
can spot problems. But then NULL is just as good a poison value as any
other - and that's what we are using today. Just, I'd prefer if every
driver didn't have to do it.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux