IB/ucm: Initialize sgid request GID attribute pointer
authorParav Pandit <parav@mellanox.com>
Mon, 6 Aug 2018 04:45:51 +0000 (07:45 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 7 Aug 2018 18:56:10 +0000 (12:56 -0600)
sgid_attr is uninitialized on the stack, initialize it to NULL.

Fixes: 398391071f25 ("IB/cm: Replace members of sa_path_rec with 'struct sgid_attr *'")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Yossi Itigin <yosefe@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/ucm.c

index 9eef96d..3e21a87 100644 (file)
@@ -1000,14 +1000,11 @@ static ssize_t ib_ucm_send_sidr_req(struct ib_ucm_file *file,
                                    const char __user *inbuf,
                                    int in_len, int out_len)
 {
-       struct ib_cm_sidr_req_param param;
+       struct ib_cm_sidr_req_param param = {};
        struct ib_ucm_context *ctx;
        struct ib_ucm_sidr_req cmd;
        int result;
 
-       param.private_data = NULL;
-       param.path = NULL;
-
        if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
                return -EFAULT;