* [PATCH] pps: Return PTR_ERR on error in device_create
@ 2012-06-01 19:43 ` Emil Goode
0 siblings, 0 replies; 4+ messages in thread
From: Emil Goode @ 2012-06-01 19:43 UTC (permalink / raw)
To: giometti; +Cc: linux-kernel, kernel-janitors, Emil Goode
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>
---
drivers/pps/pps.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index 98fbe62..e771487 100644
--- 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;
--
1.7.10
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] pps: Return PTR_ERR on error in device_create
@ 2012-06-01 19:43 ` Emil Goode
0 siblings, 0 replies; 4+ messages in thread
From: Emil Goode @ 2012-06-01 19:43 UTC (permalink / raw)
To: giometti; +Cc: linux-kernel, kernel-janitors, Emil Goode
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>
---
drivers/pps/pps.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index 98fbe62..e771487 100644
--- 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;
--
1.7.10
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] pps: Return PTR_ERR on error in device_create
2012-06-01 19:43 ` Emil Goode
@ 2012-07-14 7:31 ` devendra.aaru
-1 siblings, 0 replies; 4+ messages in thread
From: devendra.aaru @ 2012-07-14 7:13 UTC (permalink / raw)
To: Emil Goode
Cc: Andrew Morton, Alexander Gordeev, giometti, linux-kernel,
kernel-janitors
CCing Andrew Morton, and Alexander Gordeev based on git log drivers/pps/pps.c
Pardon me if i made wrong
On Sat, Jun 2, 2012 at 1:28 AM, Emil Goode <emilgoode@gmail.com> wrote:
> 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>
> ---
> drivers/pps/pps.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
> index 98fbe62..e771487 100644
> --- 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;
>
> --
> 1.7.10
>
Acked-By: Devendra Naga <devendra.aaru@gmail.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pps: Return PTR_ERR on error in device_create
@ 2012-07-14 7:31 ` devendra.aaru
0 siblings, 0 replies; 4+ messages in thread
From: devendra.aaru @ 2012-07-14 7:31 UTC (permalink / raw)
To: Emil Goode
Cc: Andrew Morton, Alexander Gordeev, giometti, linux-kernel,
kernel-janitors
CCing Andrew Morton, and Alexander Gordeev based on git log drivers/pps/pps.c
Pardon me if i made wrong
On Sat, Jun 2, 2012 at 1:28 AM, Emil Goode <emilgoode@gmail.com> wrote:
> 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>
> ---
> drivers/pps/pps.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
> index 98fbe62..e771487 100644
> --- 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;
>
> --
> 1.7.10
>
Acked-By: Devendra Naga <devendra.aaru@gmail.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-14 7:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-01 19:43 [PATCH] pps: Return PTR_ERR on error in device_create Emil Goode
2012-06-01 19:43 ` Emil Goode
2012-07-14 7:13 ` devendra.aaru
2012-07-14 7:31 ` devendra.aaru
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.