diff options
author | Emil Goode <emilgoode@gmail.com> | 2012-07-30 17:42:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:21 -0400 |
commit | 668f06b9fb846ecedb73964ca5dd95ce441707be (patch) | |
tree | 973d6e63af978ae1fdafdf6ec273cafaf0a2eb35 /drivers/pps/pps.c | |
parent | 25353b3377d5a75d4b830477bb90a3691155de72 (diff) |
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 <emilgoode@gmail.com>
Acked-by: Devendra Naga <devendra.aaru@gmail.com>
Cc: Alexander Gordeev <lasaine@lvk.cs.msu.su>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pps/pps.c')
-rw-r--r-- | drivers/pps/pps.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c index 98fbe62694d4..e771487132f7 100644 --- a/drivers/pps/pps.c +++ b/drivers/pps/pps.c | |||
@@ -327,8 +327,10 @@ int pps_register_cdev(struct pps_device *pps) | |||
327 | } | 327 | } |
328 | pps->dev = device_create(pps_class, pps->info.dev, devt, pps, | 328 | pps->dev = device_create(pps_class, pps->info.dev, devt, pps, |
329 | "pps%d", pps->id); | 329 | "pps%d", pps->id); |
330 | if (IS_ERR(pps->dev)) | 330 | if (IS_ERR(pps->dev)) { |
331 | err = PTR_ERR(pps->dev); | ||
331 | goto del_cdev; | 332 | goto del_cdev; |
333 | } | ||
332 | 334 | ||
333 | pps->dev->release = pps_device_destruct; | 335 | pps->dev->release = pps_device_destruct; |
334 | 336 | ||