projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25353b3
)
pps: return PTR_ERR on error in device_create
author
Emil Goode
<
[email protected]
>
Mon, 30 Jul 2012 21:42:51 +0000
(14:42 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 31 Jul 2012 00:25:21 +0000
(17:25 -0700)
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]
>
drivers/pps/pps.c
patch
|
blob
|
history
diff --git
a/drivers/pps/pps.c
b/drivers/pps/pps.c
index 98fbe62694d4eddbead50fde0de22fe834ce67a4..e771487132f7542123a0e8a669cd8582481ab051 100644
(file)
--- a/
drivers/pps/pps.c
+++ b/
drivers/pps/pps.c
@@
-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;