diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 171841ad10089feef1aea6e6035327a68e745604..49139a1ee25e6963bd532e8ef2376ed3e5675a11 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -322,7 +322,11 @@ static int fw_get_filesystem_firmware(struct device *device, { int i; int rc = -ENOENT; - char *path = __getname(); + char *path; + + path = __getname(); + if (!path) + return -ENOMEM; for (i = 0; i < ARRAY_SIZE(fw_path); i++) { struct file *file;