Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

SFI: do not return freed pointer

We never actually use the return value of sfi_sysfs_install_table() but
it still seems wrong to return a freed pointer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Dan Carpenter and committed by
Len Brown
e29df91e 67a3e12b

+3 -1
+3 -1
drivers/sfi/sfi_core.c
··· 441 441 442 442 ret = sysfs_create_bin_file(tables_kobj, 443 443 &tbl_attr->attr); 444 - if (ret) 444 + if (ret) { 445 445 kfree(tbl_attr); 446 + tbl_attr = NULL; 447 + } 446 448 447 449 sfi_unmap_table(th); 448 450 return tbl_attr;