[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201005280745.06299.oneukum@suse.de>
Date: Fri, 28 May 2010 07:45:06 +0200
From: Oliver Neukum <oneukum@...e.de>
To: Axel Lin <axel.lin@...il.com>
Cc: "linux-kernel" <linux-kernel@...r.kernel.org>,
Oliver Neukum <oliver@...kum.name>,
"Greg Kroah-Hartman" <gregkh@...e.de>,
Alan Cox <alan@...ux.intel.com>,
Francesco Lavra <francescolavra@...erfree.it>,
Julian Calaby <julian.calaby@...il.com>,
linux-usb@...r.kernel.org
Subject: Re: [PATCH] cdc-acm: fix resource reclaim in error path of acm_probe
Am Freitag, 28. Mai 2010 05:28:31 schrieb Axel Lin:
> This patch fixes resource reclaim in error path of acm_probe:
> 1. In the case of "out of memory (write urbs usb_alloc_urb)",
> usb_alloc_urb may fail in any iteration of the for loop.
> Current implementation does not properly free allocated snd->urb.
Yes.
> 2. In the case of device_create_file(&intf->dev,&dev_attr_iCountryCodeRelDate)
> fail, acm->country_codes is kfreed. As a result, device_remove_file for
> dev_attr_wCountryCodes will not be executed in acm_disconnect.
Yes.
> 3. This patch also improves the error handling by only reclaim successfully
> allocated resources instead of iterate over all entries in the for loop.
Please don't do that. Simplicity and correctness are the only goals designing
error handling.
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists