Re: [patch v2] net/usb: remove err() messages in few drivers

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

 



Am Tuesday 13 January 2009 11:08:27 schrieb Alexey Klimov:
> On Tue, Jan 13, 2009 at 12:44 PM, David Brownell <david-b@xxxxxxxxxxx> wrote:
> > On Tuesday 13 January 2009, Oliver Neukum wrote:
> >> > Ok, i'll reformat patch. Is it okay if i use kaweth->dev->dev,
> >> > kaweth->net->dev and intf->dev ? Or switch to kaweth->net->dev
> >> > (instead of dev->dev)?
> >>
> >> kaweth in kaweth_disconnect() frees the network device. Therefore
> >> you cannot use it. You'd access freed memory. Pick one of the others
> >> and stay with it.
> >
> > intf->dev is going to be "obviously correct", the others aren't.
> >
> 
> Is this patch touch  kaweth_disconnect() ? I see dev_warn and dev_info
> there. No dev_err.

No, it does not. But you need to make sure that the devices you refer to
in debug messages are always valid. Functions that you do touch may
run after disconnect() has run. A debug message that oopses does no good.
If you cannot make sure you pass a valid device to dev_err/info don't use
them. It is as simple as that.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux