* [PATCH] char: hvc: check for error case
@ 2010-09-12 18:57 Vasiliy Kulikov
2010-09-13 13:12 ` Chris Metcalf
0 siblings, 1 reply; 3+ messages in thread
From: Vasiliy Kulikov @ 2010-09-12 18:57 UTC (permalink / raw)
To: kernel-janitors
Cc: Arnd Bergmann, linux-kernel, Chris Metcalf, FUJITA Tomonori,
Paul Mundt, linuxppc-dev
hvc_alloc() may fail, if so exit from init() with error.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
I cannot compile this driver at all, so it is not tested.
drivers/char/hvc_tile.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/char/hvc_tile.c b/drivers/char/hvc_tile.c
index c4efb55..7a84a05 100644
--- a/drivers/char/hvc_tile.c
+++ b/drivers/char/hvc_tile.c
@@ -61,7 +61,8 @@ console_initcall(hvc_tile_console_init);
static int __init hvc_tile_init(void)
{
- hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128);
- return 0;
+ struct hvc_struct *s;
+ s = hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128);
+ return IS_ERR(s) ? PTR_ERR(s) : 0;
}
device_initcall(hvc_tile_init);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] char: hvc: check for error case
2010-09-12 18:57 [PATCH] char: hvc: check for error case Vasiliy Kulikov
@ 2010-09-13 13:12 ` Chris Metcalf
2010-09-13 13:32 ` Vasiliy Kulikov
0 siblings, 1 reply; 3+ messages in thread
From: Chris Metcalf @ 2010-09-13 13:12 UTC (permalink / raw)
To: Vasiliy Kulikov
Cc: Arnd Bergmann, kernel-janitors, linux-kernel, FUJITA Tomonori,
Paul Mundt, linuxppc-dev
On 9/12/2010 2:57 PM, Vasiliy Kulikov wrote:
> hvc_alloc() may fail, if so exit from init() with error.
>
> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Thanks, accepted into my tree (for the next merge window). In practice all
this means is in debug mode we'll get a warning from do_one_initcall()
rather than silence, but you're right, it's technically better. :-)
> ---
> I cannot compile this driver at all, so it is not tested.
>
> drivers/char/hvc_tile.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/hvc_tile.c b/drivers/char/hvc_tile.c
> index c4efb55..7a84a05 100644
> --- a/drivers/char/hvc_tile.c
> +++ b/drivers/char/hvc_tile.c
> @@ -61,7 +61,8 @@ console_initcall(hvc_tile_console_init);
>
> static int __init hvc_tile_init(void)
> {
> - hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128);
> - return 0;
> + struct hvc_struct *s;
> + s = hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128);
> + return IS_ERR(s) ? PTR_ERR(s) : 0;
> }
> device_initcall(hvc_tile_init);
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] char: hvc: check for error case
2010-09-13 13:12 ` Chris Metcalf
@ 2010-09-13 13:32 ` Vasiliy Kulikov
0 siblings, 0 replies; 3+ messages in thread
From: Vasiliy Kulikov @ 2010-09-13 13:32 UTC (permalink / raw)
To: Chris Metcalf
Cc: Arnd Bergmann, kernel-janitors, linux-kernel, FUJITA Tomonori,
Paul Mundt, linuxppc-dev
On Mon, Sep 13, 2010 at 09:12 -0400, Chris Metcalf wrote:
> Thanks, accepted into my tree (for the next merge window). In practice all
> this means is in debug mode we'll get a warning from do_one_initcall()
> rather than silence, but you're right, it's technically better. :-)
Anyway it's better, if user sees warning in the dmesg, he/she might
response to this situation.
Best,
--
Vasiliy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-13 13:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-12 18:57 [PATCH] char: hvc: check for error case Vasiliy Kulikov
2010-09-13 13:12 ` Chris Metcalf
2010-09-13 13:32 ` Vasiliy Kulikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).