Re: [GIT PATCH] Fix memory leak in qcserial driver

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

 



On Mon, Mar 28, 2011 at 01:34:24PM -0400, Aristeu Rozanski wrote:
> > +	usb_set_serial_data(serial, data);
> >  	return retval;
> >  }
> when there's a -ENODEV, kfree() is called but the now invalid address is
> set by usb_set_serial_data() anyway. am I missing something here?

The intention here is that since data should be NULL after the kfree, we're simply setting serial->private to NULL.

I can add a conditional to avoid calling usb_set_serial_data() for -ENODEV if it's deemed cleaner or more readable.

Thanks for the comments,

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