firmware_class: Add null check in fw_get_filesystem_firmware

Add null check for the return value of kmem_cache_alloc before
using it.

CRs-Fixed: 836643
Change-Id: If0d8055b84fb9f9c372a68acc2a53f39035fffef
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
This commit is contained in:
Devesh Jhunjhunwala 2015-05-22 12:22:11 -07:00
parent d765f15445
commit 590c1ceef7
1 changed files with 2 additions and 0 deletions

View File

@ -362,6 +362,8 @@ static bool fw_get_filesystem_firmware(struct device *device,
int i;
bool success = false;
char *path = __getname();
if (!path)
return false;
for (i = 0; i < ARRAY_SIZE(fw_path); i++) {
struct file *file;