Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/iser: Support iSCSI PDU padding
  IBiser: Fix wrong mask when sizeof (dma_addr_t) > sizeof (unsigned long)
  IPoIB: Fix possible NULL dereference in ipoib_start_xmit()
  • Loading branch information
Linus Torvalds committed Aug 18, 2011
2 parents f6a975c + 80b43de commit fbad899
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 5 additions & 3 deletions drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,13 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
struct ipoib_neigh *neigh;
struct neighbour *n;
struct neighbour *n = NULL;
unsigned long flags;

n = dst_get_neighbour(skb_dst(skb));
if (likely(skb_dst(skb) && n)) {
if (likely(skb_dst(skb)))
n = dst_get_neighbour(skb_dst(skb));

if (likely(n)) {
if (unlikely(!*to_ipoib_neigh(n))) {
ipoib_path_lookup(skb, dev);
return NETDEV_TX_OK;
Expand Down
10 changes: 7 additions & 3 deletions drivers/infiniband/ulp/iser/iscsi_iser.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,17 @@ iscsi_iser_recv(struct iscsi_conn *conn,

/* verify PDU length */
datalen = ntoh24(hdr->dlength);
if (datalen != rx_data_len) {
printk(KERN_ERR "iscsi_iser: datalen %d (hdr) != %d (IB) \n",
datalen, rx_data_len);
if (datalen > rx_data_len || (datalen + 4) < rx_data_len) {
iser_err("wrong datalen %d (hdr), %d (IB)\n",
datalen, rx_data_len);
rc = ISCSI_ERR_DATALEN;
goto error;
}

if (datalen != rx_data_len)
iser_dbg("aligned datalen (%d) hdr, %d (IB)\n",
datalen, rx_data_len);

/* read AHS */
ahslen = hdr->hlength * 4;

Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/ulp/iser/iscsi_iser.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
} while (0)

#define SHIFT_4K 12
#define SIZE_4K (1UL << SHIFT_4K)
#define SIZE_4K (1ULL << SHIFT_4K)
#define MASK_4K (~(SIZE_4K-1))

/* support up to 512KB in one RDMA */
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/ulp/iser/iser_initiator.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ int iser_send_control(struct iscsi_conn *conn,
memcpy(iser_conn->ib_conn->login_buf, task->data,
task->data_count);
tx_dsg->addr = iser_conn->ib_conn->login_dma;
tx_dsg->length = data_seg_len;
tx_dsg->length = task->data_count;
tx_dsg->lkey = device->mr->lkey;
mdesc->num_sge = 2;
}
Expand Down

0 comments on commit fbad899

Please sign in to comment.