Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115840521
D45719.id140183.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
988 B
Referenced Files
None
Subscribers
None
D45719.id140183.diff
View Options
Index: sys/dev/virtio/p9fs/virtio_p9fs.c
===================================================================
--- sys/dev/virtio/p9fs/virtio_p9fs.c
+++ sys/dev/virtio/p9fs/virtio_p9fs.c
@@ -332,6 +332,11 @@
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;
+ }
/* Negotiate the features from the host */
virtio_set_feature_desc(dev, virtio_9p_feature_desc);
@@ -367,12 +372,6 @@
SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "p9fs_mount_tag",
CTLFLAG_RD, chan->mount_tag, 0, "Mount tag");
- if (chan->vt9p_sglist == NULL) {
- error = ENOMEM;
- P9_DEBUG(ERROR, "%s: Cannot allocate sglist\n", __func__);
- goto out;
- }
-
/* We expect one virtqueue, for requests. */
error = vt9p_alloc_virtqueue(chan);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 30, 10:04 AM (15 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17855716
Default Alt Text
D45719.id140183.diff (988 B)
Attached To
Mode
D45719: 9pfs: move NULL check immediately after allocation
Attached
Detach File
Event Timeline
Log In to Comment