Re: [PATCH v3] mailbox: pcc: Add missed acpi_put_table() to fix memory leak

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

 



> In pcc_mbox_probe(), the PCCT table acquired via acpi_get_table() is
> only released in error paths but not in the success path. Fix a
> permanent ACPI memory leak when the driver successfully initializes. Add
> the goto label 'err_nomem'.

You may use an enumeration for your change description.

* Fix …

* Add … so that a bit of exception handling can be refined.


…> +++ b/drivers/mailbox/pcc.c
…> @@ -827,8 +821,11 @@ static int pcc_mbox_probe(struct platform_device *pdev)
…> +err_nomem:
> +	rc = -ENOMEM;
> +	goto err;

Please omit such a redundant statement at this proposed place.


>  err:
>  	acpi_put_table(pcct_tbl);
>  	return rc;
Would a label like “put_table” become helpful here?

Regards,
Markus





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux