mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
pps: return PTR_ERR on error in device_create
We should return PTR_ERR if the call to the device_create function fails. Without this patch we instead return the value from a successful call to cdev_add if the call to device_create fails. Signed-off-by: Emil Goode <[email protected]> Acked-by: Devendra Naga <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Rodolfo Giometti <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
25353b3377
commit
668f06b9fb
1 changed files with 3 additions and 1 deletions
|
|
@ -327,8 +327,10 @@ int pps_register_cdev(struct pps_device *pps)
|
|||
}
|
||||
pps->dev = device_create(pps_class, pps->info.dev, devt, pps,
|
||||
"pps%d", pps->id);
|
||||
if (IS_ERR(pps->dev))
|
||||
if (IS_ERR(pps->dev)) {
|
||||
err = PTR_ERR(pps->dev);
|
||||
goto del_cdev;
|
||||
}
|
||||
|
||||
pps->dev->release = pps_device_destruct;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue