Commit 5b940adf authored by Mike Christie's avatar Mike Christie Committed by

[SCSI] iscsi update: pass correct skb to skb_trim

>From da-x@monatomic.org:

Wrong skb is passed to skb_trim in iscsi_if_get_stats.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarAlex Aizman <itn780@yahoo.com>
Signed-off-by: default avatarDmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 7b7232f3
...@@ -680,8 +680,7 @@ iscsi_if_send_reply(int pid, int seq, int type, int done, int multi, ...@@ -680,8 +680,7 @@ iscsi_if_send_reply(int pid, int seq, int type, int done, int multi,
} }
static int static int
iscsi_if_get_stats(struct iscsi_transport *transport, struct sk_buff *skb, iscsi_if_get_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
struct nlmsghdr *nlh)
{ {
struct iscsi_uevent *ev = NLMSG_DATA(nlh); struct iscsi_uevent *ev = NLMSG_DATA(nlh);
struct iscsi_stats *stats; struct iscsi_stats *stats;
...@@ -732,7 +731,7 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct sk_buff *skb, ...@@ -732,7 +731,7 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct sk_buff *skb,
stats->custom_length); stats->custom_length);
actual_size -= sizeof(*nlhstat); actual_size -= sizeof(*nlhstat);
actual_size = NLMSG_LENGTH(actual_size); actual_size = NLMSG_LENGTH(actual_size);
skb_trim(skb, NLMSG_ALIGN(actual_size)); skb_trim(skbstat, NLMSG_ALIGN(actual_size));
nlhstat->nlmsg_len = actual_size; nlhstat->nlmsg_len = actual_size;
err = iscsi_unicast_skb(conn->z_pdu, skbstat); err = iscsi_unicast_skb(conn->z_pdu, skbstat);
...@@ -923,7 +922,7 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) ...@@ -923,7 +922,7 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
err = -EINVAL; err = -EINVAL;
break; break;
case ISCSI_UEVENT_GET_STATS: case ISCSI_UEVENT_GET_STATS:
err = iscsi_if_get_stats(transport, skb, nlh); err = iscsi_if_get_stats(transport, nlh);
break; break;
default: default:
err = -EINVAL; err = -EINVAL;
......
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