Current code does not close 'fd' on function exit, leaking resources.
Fixes:
2ea6f76aff40 ("qede: add core driver")
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Harish Patil <harish.patil@qlogic.com>
if (fstat(fd, &st) < 0) {
DP_NOTICE(edev, false, "Can't stat firmware file\n");
+ close(fd);
return -1;
}
if (edev->fw_len < 104) {
DP_NOTICE(edev, false, "Invalid fw size: %" PRIu64 "\n",
edev->fw_len);
+ close(fd);
return -EINVAL;
}
+ close(fd);
return 0;
}
#endif