IB/sa: Put netlink request into the request list before sending
IB/sa: Put netlink request into the request list before sending

It was found by Saurabh Sengar that the netlink code tried to allocate
memory with GFP_KERNEL while holding a spinlock. While it is possible
to fix the issue by replacing GFP_KERNEL with GFP_ATOMIC, it is better
to get rid of the spinlock while sending the packet. However, in order
to protect against a race condition that a quick response may be received
before the request is put on the request list, we need to put the request
on the list first.

Signed-off-by: Kaike Wan <b0fecb2b75fcd26b373312f3d66f04fb58e0442d@intel.com>
Reviewed-by: Jason Gunthorpe <a99b91d77388df0ccdee94a722cec2f833ed4ae5@obsidianresearch.com>
Reviewed-by: Ira Weiny <5535a83d6b33e2bc00edcbbbebec5c5b8e5537a3@intel.com>
Reported-by: Saurabh Sengar <2db3a5fe5d908d97026733b45c9a86a5232093ea@gmail.com>
Signed-off-by: Doug Ledford <f35204f44eabfe97bbcdd18aee9e9fffc59f29e1@redhat.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs