Re: [PATCH] smscoreapi: memory leak fix

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

 



Hi Roberto,

Thanks for the patch.

On Tue, May 21, 2013 at 05:32:30PM -0300, Roberto Alcântara wrote:
> Ensure release_firmware is called if kmalloc fails.
> 
> Signed-off-by:Roberto Alcantara <roberto@xxxxxxxxxxxxxx>
> diff --git a/linux/drivers/media/common/siano/smscoreapi.c
> b/linux/drivers/media/common/siano/smscoreapi.c
> index dbe9b4d..f65b4e3 100644
> --- a/linux/drivers/media/common/siano/smscoreapi.c
> +++ b/linux/drivers/media/common/siano/smscoreapi.c
> @@ -1173,16 +1173,16 @@ static int
> smscore_load_firmware_from_file(struct smscore_device_t *coredev,
>               GFP_KERNEL | GFP_DMA);
>      if (!fw_buf) {
>          sms_err("failed to allocate firmware buffer");
> -        return -ENOMEM;

How about instead adding a label before release_firmware() for error
handling? I think that'd be cleaner than this.

Could you also use git send-email to send the patch, please?

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@xxxxxx	XMPP: sailus@xxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux