This patch does the following things:
- Make hidp_setup_input() return int to indicate errors.
- Check its return value to handle errors.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
---
net/bluetooth/hidp/core.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: linux-2.6.23-rc6-mm1/net/bluetooth/hidp/core.c
===================================================================
--- linux-2.6.23-rc6-mm1.orig/net/bluetooth/hidp/core.c
+++ linux-2.6.23-rc6-mm1/net/bluetooth/hidp/core.c
@@ -625,7 +625,7 @@ static struct device *hidp_get_device(st
return conn ? &conn->dev : NULL;
}
-static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req)
+static inline int hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req)
{
struct input_dev *input = session->input;
int i;
@@ -669,7 +669,7 @@ static inline void hidp_setup_input(stru
input->event = hidp_input_event;
- input_register_device(input);
+ return input_register_device(input);
}
static int hidp_open(struct hid_device *hid)
@@ -823,7 +823,8 @@ int hidp_add_connection(struct hidp_conn
session->idle_to = req->idle_to;
if (session->input)
- hidp_setup_input(session, req);
+ if ((err = (hidp_setup_input(session, req))))
+ goto failed;
if (session->hid)
hidp_setup_hid(session, req);
-
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Trent Piepho | Re: [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
| hooanon05 | [AUFS PATCH v2.6.26-rc2-mm1 00/39] AUFS: merging/stacking several filesystems |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Peter Stahlir | Git as a filesystem |
| Stephen Hemminger | git pull for update of netdev fails. |
| Jon Smirl | ! [rejected] master -> master (non-fast forward) |
| Linus Torvalds | Help with a tcl/tk gui thing.. |
| Leon Dippenaar | New tcp stack attack |
| Mayuresh Kathe | Re: What is our ultimate goal?? |
| Richard Daemon | OpenBSD 4.3 running in VirtualBox? Anyone have it working properly? |
| Shohrukh Shoyoqubov | Re: Site-to-site IPSec VPN between OpenBSD and Cisco PIX 515E |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Evgeniy Polyakov | Re: 2.6.25-rc8: FTP transfer errors |
| Eric Dumazet | Re: [PATCH] net: implement emergency route cache rebulds when gc_elasticity is exc... |
