Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=53465eb4ab16660eab0a7be168a087a97172e650
Commit:     53465eb4ab16660eab0a7be168a087a97172e650
Parent:     912d8f0b1f17b7e851ebbfeb17a16de9f9c7cb88
Author:     WANG Cong <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 25 22:57:31 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:52:39 2007 -0700

    [BLUETOOTH]: Make hidp_setup_input() return int
    
    This patch:
    - makes hidp_setup_input() return int to indicate errors;
    - checks its return value to handle errors.
    
    And this time it is against -rc7-mm1 tree.
    
    Thanks to roel and Marcel Holtmann for comments.
    
    Signed-off-by: WANG Cong <[EMAIL PROTECTED]>
    Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/bluetooth/hidp/core.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 64d89ca..ff5784b 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -625,7 +625,7 @@ static struct device *hidp_get_device(struct hidp_session 
*session)
        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;
@@ -667,7 +667,7 @@ static inline void hidp_setup_input(struct hidp_session 
*session, struct hidp_co
 
        input->event = hidp_input_event;
 
-       input_register_device(input);
+       return input_register_device(input);
 }
 
 static int hidp_open(struct hid_device *hid)
@@ -820,8 +820,11 @@ int hidp_add_connection(struct hidp_connadd_req *req, 
struct socket *ctrl_sock,
        session->flags   = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID);
        session->idle_to = req->idle_to;
 
-       if (session->input)
-               hidp_setup_input(session, req);
+       if (session->input) {
+               err = hidp_setup_input(session, req);
+               if (err < 0)
+                       goto failed;
+       }
 
        if (session->hid)
                hidp_setup_hid(session, req);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to