gpu: nvgpu: Free nvgpu_clk_dev in case of error

If nvgpu_clk_arb_install_fd() gets an error from
nvgpu_clk_notification_queue_alloc(), it fails to free the
nvgpu_clk_dev that it allocated earlier.

Direct the error case to call an appropriate fail label.

Coverity ID 1862040

Change-Id: I1d804d4f5261ec64831938f997f9efc3f2700b60
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1291683
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Terje Bergstrom
2017-01-19 15:35:47 -08:00
committed by mobile promotions
parent 29400cbbae
commit 8fa68aeb04

View File

@@ -477,9 +477,10 @@ static int nvgpu_clk_arb_install_fd(struct gk20a *g,
status = nvgpu_clk_notification_queue_alloc(&dev->queue,
DEFAULT_EVENT_NUMBER);
if (status < 0)
return status;
if (status < 0) {
err = status;
goto fail;
}
fd = get_unused_fd_flags(O_RDWR);
if (fd < 0) {