[PATCH] mtd: nand: arasan: Update the correct return codes

Dan Carpenter dan.carpenter at linaro.org
Fri Mar 1 12:37:47 CET 2024


On Fri, Mar 01, 2024 at 04:51:09PM +0530, Venkatesh Yadav Abbarapu wrote:
> The below exception observed on QEMU, as it doesn't support
> NAND controller.
> 
> "Synchronous Abort" handler, esr 0x96000005, far 0x17acfc878
> elr: 000000000803ad40 lr : 000000000805f438 (reloc)
> elr: 000000007fcb4d40 lr : 000000007fcd9438
> x0 : 000000007bbfc880 x1 : 00000000ff100000
> x2 : 000000007fcf059c x3 : 000000007bbfc870
> x4 : 000000007fd9a388 x5 : 000000017acfc870
> x6 : 0000000000000000 x7 : 000000007bbfd0e0
> x8 : 0000000000003dd4 x9 : 000000007bbeec0c
> x10: 0000000000000001 x11: 0000000000003f8c
> x12: 000000007bbeecfc x13: 000000007bbeeeb0
> x14: 000000007bbeeeb0 x15: 000000007bbee474
> x16: 000000007fcef18c x17: 0000000000000000
> x18: 000000007bbf9d70 x19: 000000007bbfc888
> x20: 000000007bbfc870 x21: 000000007fd68ddb
> x22: 00000000ffffffed x23: 000000007bbfc878
> x24: 0000000000000000 x25: 0000000000000000
> x26: 0000000000000000 x27: 0000000000000000
> x28: 0000000000000000 x29: 000000007bbeed10
> 
> Code: 927ff8c1 924000c6 8b010065 f9400887 (f94004a2)
> Resetting CPU ...
> 
> Updating the correct return codes rather than hardcoding, remove the
> free as there is no memory allocated using malloc.
> 
> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu at amd.com>

The crash is caused by the use after free because we shouldn't
free(nand)?  Returning the correct error codes is nice, but it shouldn't
cause a crash...

Fixes: 3dd0f8cccd6d ("mtd: nand: Remove hardcoded base address of nand")

regards,
dan carpenter



More information about the U-Boot mailing list