Skip to content

Commit

Permalink
usb: sierra: fix a missing check of device_create_file
Browse files Browse the repository at this point in the history
device_create_file() could fail and return an error code. The fix
captures the error and returns the error code upstream in case it
indeed failed.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Kangjie Lu authored and Greg Kroah-Hartman committed Mar 26, 2019
1 parent f926da4 commit 1a137b4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/storage/sierra_ms.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ int sierra_ms_init(struct us_data *us)
kfree(swocInfo);
}
complete:
result = device_create_file(&us->pusb_intf->dev, &dev_attr_truinst);

return 0;
return device_create_file(&us->pusb_intf->dev, &dev_attr_truinst);
}

0 comments on commit 1a137b4

Please sign in to comment.