Commit f6edbf2d authored by Justin.Lee1@Dell.com's avatar Justin.Lee1@Dell.com Committed by David S. Miller

net/ncsi: Fix the payload copying for the request coming from Netlink

The request coming from Netlink should use the OEM generic handler.

The standard command handler expects payload in bytes/words/dwords
but the actual payload is stored in data if the request is coming from Netlink.
Signed-off-by: default avatarJustin Lee <justin.lee1@dell.com>
Reviewed-by: default avatarVijay Khemka <vijaykhemka@fb.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4df0d839
...@@ -309,14 +309,21 @@ static struct ncsi_request *ncsi_alloc_command(struct ncsi_cmd_arg *nca) ...@@ -309,14 +309,21 @@ static struct ncsi_request *ncsi_alloc_command(struct ncsi_cmd_arg *nca)
int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca) int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)
{ {
struct ncsi_cmd_handler *nch = NULL;
struct ncsi_request *nr; struct ncsi_request *nr;
unsigned char type;
struct ethhdr *eh; struct ethhdr *eh;
struct ncsi_cmd_handler *nch = NULL;
int i, ret; int i, ret;
/* Use OEM generic handler for Netlink request */
if (nca->req_flags == NCSI_REQ_FLAG_NETLINK_DRIVEN)
type = NCSI_PKT_CMD_OEM;
else
type = nca->type;
/* Search for the handler */ /* Search for the handler */
for (i = 0; i < ARRAY_SIZE(ncsi_cmd_handlers); i++) { for (i = 0; i < ARRAY_SIZE(ncsi_cmd_handlers); i++) {
if (ncsi_cmd_handlers[i].type == nca->type) { if (ncsi_cmd_handlers[i].type == type) {
if (ncsi_cmd_handlers[i].handler) if (ncsi_cmd_handlers[i].handler)
nch = &ncsi_cmd_handlers[i]; nch = &ncsi_cmd_handlers[i];
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment