Re: [PATCH] mmc: mmc_spi: Adjust error handling in mmc_spi_probe()

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

 



On Wed, Dec 27, 2023 at 12:50:50PM +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> Date: Wed, 27 Dec 2023 12:23:20 +0100
> 
> The kfree() function was called in one case by
> the mmc_spi_probe() function during error handling
> even if the passed variable contained a null pointer.
> This issue was detected by using the Coccinelle software.

> * Thus return directly after a call of the function “kmalloc” failed
>   at the beginning.
> 
> * Move an error code assignment into an if branch.

How is this one better?

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux