cxl: fix potential NULL dereference in free_adapter()
Michael Ellerman
patch-notifications at ellerman.id.au
Wed Jul 20 19:10:21 AEST 2016
On Fri, 2016-15-07 at 07:20:36 UTC, Andrew Donnellan wrote:
> If kzalloc() fails when allocating adapter->guest in
> cxl_guest_init_adapter(), we call free_adapter() before erroring out.
> free_adapter() in turn attempts to dereference adapter->guest, which in
> this case is NULL.
>
> In free_adapter(), skip the adapter->guest cleanup if adapter->guest is
> NULL.
>
> Fixes: 14baf4d9c739 ("cxl: Add guest-specific code")
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
> Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/8fbaa51d43ef2c6a72849ec340
cheers
More information about the Linuxppc-dev
mailing list