Skip to content

Commit

Permalink
p9fs: use M_WAITOK where appropriate
Browse files Browse the repository at this point in the history
device_attach routines are allowed to sleep, and this routine already
has other M_WAITOK allocations.

Reported by:	markj
Reviewed by:	markj
Fixes: 1efd69f ("p9fs: move NULL check immediately after alloc...")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45721
  • Loading branch information
emaste committed Jun 25, 2024
1 parent 6176883 commit e6b8823
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions sys/dev/virtio/p9fs/virtio_p9fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,7 @@ vt9p_attach(device_t dev)
/* Initialize the condition variable */
cv_init(&chan->submit_cv, "Conditional variable for submit queue" );
chan->max_nsegs = MAX_SUPPORTED_SGS;
chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_NOWAIT);
if (chan->vt9p_sglist == NULL) {
error = ENOMEM;
P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__);
goto out;
}
chan->vt9p_sglist = sglist_alloc(chan->max_nsegs, M_WAITOK);

/* Negotiate the features from the host */
virtio_set_feature_desc(dev, virtio_9p_feature_desc);
Expand Down

0 comments on commit e6b8823

Please sign in to comment.