mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-09-22 15:42:04 +00:00
f_fastboot: Avoid use-after-free in the global pointer variable
In case of usb_add_function() failure the error path has an issue, i.e the global pointer variable is assigned to garbage Fix the above mentioned issue by assigning pointer to NULL. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
ff52577c1b
commit
6ffc8e2993
1 changed files with 1 additions and 1 deletions
|
@ -315,7 +315,7 @@ static int fastboot_add(struct usb_configuration *c)
|
|||
status = usb_add_function(c, &f_fb->usb_function);
|
||||
if (status) {
|
||||
free(f_fb);
|
||||
fastboot_func = f_fb;
|
||||
fastboot_func = NULL;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
|
Loading…
Reference in a new issue