Skip to content

Commit e4c05b3

Browse files
Dan Carpentergregkh
authored andcommitted
drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
commit f0c62e9878024300319ba2438adc7b06c6b9c448 upstream. If vmalloc() fails then we need to a bit of cleanup before returning. Fixes: fb1d973 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e582b82 commit e4c05b3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ static void *vmw_local_fifo_reserve(struct vmw_private *dev_priv,
368368
return fifo_state->static_buffer;
369369
else {
370370
fifo_state->dynamic_buffer = vmalloc(bytes);
371+
if (!fifo_state->dynamic_buffer)
372+
goto out_err;
371373
return fifo_state->dynamic_buffer;
372374
}
373375
}

0 commit comments

Comments
 (0)