Skip to content

Commit

Permalink
USB: udl: proper error reporting
Browse files Browse the repository at this point in the history
Parsing device descriptors can fail due to a failed memory
allocation. The error needs to be properly propagated to the
upper layers.

Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Oliver Neukum authored and gregkh committed May 27, 2014
1 parent c78d1ec commit 737583f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/udl/udl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ int udl_submit_urb(struct drm_device *dev, struct urb *urb, size_t len)
int udl_driver_load(struct drm_device *dev, unsigned long flags)
{
struct udl_device *udl;
int ret;
int ret = -ENOMEM;

DRM_DEBUG("\n");
udl = kzalloc(sizeof(struct udl_device), GFP_KERNEL);
Expand All @@ -299,7 +299,6 @@ int udl_driver_load(struct drm_device *dev, unsigned long flags)
}

if (!udl_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
ret = -ENOMEM;
DRM_ERROR("udl_alloc_urb_list failed\n");
goto err;
}
Expand Down

0 comments on commit 737583f

Please sign in to comment.