diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2011-10-06 03:56:59 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-20 10:12:44 -0500 |
commit | 00c31889f7513e9ffa6b2b4de8ad6d7f59a61c80 (patch) | |
tree | 6ba665724a1aed89f962598c323af9be18ce5688 /drivers/scsi/scsi_transport_iscsi.c | |
parent | 88f4f5170fe74ae28443f304fcd226ddcf84f592 (diff) | |
download | lwn-00c31889f7513e9ffa6b2b4de8ad6d7f59a61c80.tar.gz lwn-00c31889f7513e9ffa6b2b4de8ad6d7f59a61c80.zip |
[SCSI] qla4xxx: fix data alignment and use nl helpers
This has the driver use helpers for a common operation and fixes
a issue where if multiple iscsi params are sent they could be
sent at offsets that cause unaligned accesses. The nla helpers
account for the padding needed to align properly for the driver.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 522423bdcb56..142a09a3afbf 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -1890,7 +1890,7 @@ iscsi_set_path(struct iscsi_transport *transport, struct iscsi_uevent *ev) static int iscsi_set_iface_params(struct iscsi_transport *transport, - struct iscsi_uevent *ev) + struct iscsi_uevent *ev, uint32_t len) { char *data = (char *)ev + sizeof(*ev); struct Scsi_Host *shost; @@ -1906,8 +1906,7 @@ iscsi_set_iface_params(struct iscsi_transport *transport, return -ENODEV; } - err = transport->set_iface_param(shost, data, - ev->u.set_iface_params.count); + err = transport->set_iface_param(shost, data, len); scsi_host_put(shost); return err; } @@ -2052,7 +2051,8 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group) err = iscsi_set_path(transport, ev); break; case ISCSI_UEVENT_SET_IFACE_PARAMS: - err = iscsi_set_iface_params(transport, ev); + err = iscsi_set_iface_params(transport, ev, + nlmsg_attrlen(nlh, sizeof(*ev))); break; default: err = -ENOSYS; |