All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] ifb: fix oops when loading the ifb failed
@ 2013-07-11 11:04 Ding Tianhong
  2013-07-11 19:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ding Tianhong @ 2013-07-11 11:04 UTC (permalink / raw)
  To: David S. Miller, Patrick McHardy, Eric Dumazet, Netdev

If __rtnl_link_register() return faild when loading the ifb, it will
take the wrong path and get oops, so fix it just like dummy.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/ifb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index dc9f6a4..23a33e3 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -291,11 +291,15 @@ static int __init ifb_init_module(void)
 
 	rtnl_lock();
 	err = __rtnl_link_register(&ifb_link_ops);
+	if (err < 0)
+		goto out;
 
 	for (i = 0; i < numifbs && !err; i++)
 		err = ifb_init_one(i);
 	if (err)
 		__rtnl_link_unregister(&ifb_link_ops);
+
+out:
 	rtnl_unlock();
 
 	return err;
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] ifb: fix oops when loading the ifb failed
  2013-07-11 11:04 [PATCH 2/2] ifb: fix oops when loading the ifb failed Ding Tianhong
@ 2013-07-11 19:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-07-11 19:00 UTC (permalink / raw)
  To: dingtianhong; +Cc: kaber, edumazet, netdev

From: Ding Tianhong <dingtianhong@huawei.com>
Date: Thu, 11 Jul 2013 19:04:06 +0800

> If __rtnl_link_register() return faild when loading the ifb, it will
> take the wrong path and get oops, so fix it just like dummy.
> 
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-11 19:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-11 11:04 [PATCH 2/2] ifb: fix oops when loading the ifb failed Ding Tianhong
2013-07-11 19:00 ` David Miller

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.