Revert "aoe: fix the potential use-after-free problem in more places"

This reverts commit f90b29e234.
This commit is contained in:
Ksawlii 2024-11-24 00:23:02 +01:00
parent 609a82bb00
commit d99618755c

View file

@ -362,7 +362,6 @@ ata_rw_frameinit(struct frame *f)
}
ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit;
dev_hold(t->ifp->nd);
skb->dev = t->ifp->nd;
}
@ -403,8 +402,6 @@ aoecmd_ata_rw(struct aoedev *d)
__skb_queue_head_init(&queue);
__skb_queue_tail(&queue, skb);
aoenet_xmit(&queue);
} else {
dev_put(f->t->ifp->nd);
}
return 1;
}
@ -487,13 +484,10 @@ resend(struct aoedev *d, struct frame *f)
memcpy(h->dst, t->addr, sizeof h->dst);
memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src);
dev_hold(t->ifp->nd);
skb->dev = t->ifp->nd;
skb = skb_clone(skb, GFP_ATOMIC);
if (skb == NULL) {
dev_put(t->ifp->nd);
if (skb == NULL)
return;
}
f->sent = ktime_get();
__skb_queue_head_init(&queue);
__skb_queue_tail(&queue, skb);
@ -624,8 +618,6 @@ probe(struct aoetgt *t)
__skb_queue_head_init(&queue);
__skb_queue_tail(&queue, skb);
aoenet_xmit(&queue);
} else {
dev_put(f->t->ifp->nd);
}
}
@ -1411,7 +1403,6 @@ aoecmd_ata_id(struct aoedev *d)
ah->cmdstat = ATA_CMD_ID_ATA;
ah->lba3 = 0xa0;
dev_hold(t->ifp->nd);
skb->dev = t->ifp->nd;
d->rttavg = RTTAVG_INIT;
@ -1421,8 +1412,6 @@ aoecmd_ata_id(struct aoedev *d)
skb = skb_clone(skb, GFP_ATOMIC);
if (skb)
f->sent = ktime_get();
else
dev_put(t->ifp->nd);
return skb;
}