Commit Graph

2 Commits

Author SHA1 Message Date
Deepak Nibade
d0955cad82 gpu: nvgpu: fix resource leak in error path
In nvgpu_request_firmware(), if fw->data is NULL, we jump
to label "err" and leak the storage pointed by linux_fw

Fix this by releasing firmware in error path if
fw->data is NULL

Coverity id : 2513066
Bug 200291879

Change-Id: Ieb5e22137cebb4cd02415b805941969b95a38668
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1479884
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2017-05-12 06:24:27 -07:00
Terje Bergstrom
a9c66768db gpu: nvgpu: Add abstraction for firmware loading
Add nvgpu_firmware data structure, and return it instead of Linux
struct firmare from nvgpu_request_firmware. Also add abstraction
for releasing firmware: nvgpu_release_firmware.

JIRA NVGPU-16

Change-Id: I6dae8262957c0d4506f710289e3a43a6c1729fc7
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1463538
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-19 12:16:02 -07:00