usb: sierra: fix a missing check of device_create_file

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>
This commit is contained in:
Kangjie Lu 2019-03-24 22:08:28 -05:00 committed by Greg Kroah-Hartman
parent f926da4221
commit 1a137b47ce
1 changed files with 1 additions and 3 deletions

View File

@ -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);
}