mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 05:58:57 +00:00
Guard against transfers of zero length given to *strategy.
This commit is contained in:
parent
3abe5082ad
commit
af86437301
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55546
@ -301,6 +301,13 @@ adstrategy(struct buf *bp)
|
||||
struct ad_softc *adp = bp->b_dev->si_drv1;
|
||||
int32_t s;
|
||||
|
||||
/* if it's a null transfer, return immediatly. */
|
||||
if (bp->b_bcount == 0) {
|
||||
bp->b_resid = 0;
|
||||
biodone(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
s = splbio();
|
||||
bufqdisksort(&adp->queue, bp);
|
||||
ad_start(adp);
|
||||
|
@ -1030,7 +1030,7 @@ acdstrategy(struct buf *bp)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* if it's a null transfer, return immediatly. */
|
||||
if (bp->b_bcount == 0) {
|
||||
bp->b_resid = 0;
|
||||
biodone(bp);
|
||||
|
@ -254,6 +254,13 @@ afdstrategy(struct buf *bp)
|
||||
struct afd_softc *fdp = bp->b_dev->si_drv1;
|
||||
int32_t s;
|
||||
|
||||
/* if it's a null transfer, return immediatly. */
|
||||
if (bp->b_bcount == 0) {
|
||||
bp->b_resid = 0;
|
||||
biodone(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
s = splbio();
|
||||
bufq_insert_tail(&fdp->buf_queue, bp);
|
||||
afd_start(fdp);
|
||||
@ -267,7 +274,7 @@ afd_start(struct afd_softc *fdp)
|
||||
u_int32_t lba, count;
|
||||
int8_t ccb[16];
|
||||
int8_t *data_ptr;
|
||||
|
||||
|
||||
if (!bp)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user