virtiofsd: move assert just after calloc()
PATCH 1/1 virtiofsd: move assert just after calloc()
It's better to assert NULL pointer just after calloc().
Signed-off-by Jun Piao <[email protected]>
--- contrib/virtiofsd/fuse_virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/virtiofsd/fuse_virtio.c +1 -1
@@ -748,9 +748,9 @@ static void fv_queue_set_started(VuDev *dev, int qidx, bool started) }if (!vud->qi[qidx]) { vud->qi[qidx] =calloc (sizeof (struct fv_QueueInfo ),1 ); +assert (vud->qi[qidx]); vud->qi[qidx]->virtio_dev = vud; vud->qi[qidx]->qidx = qidx; -assert (vud->qi[qidx]); }else {/* Shouldn't have been started */ assert (vud->qi[qidx]->kick_fd ==-1 );
Quoted 3 lines · * piaojun ([email protected]) wrote:
It's better to assert NULL pointer just after
calloc().Signed-off-by Jun Piao <[email protected]>
Thanks, squashed into 'virtiofsd: Start queue threads'
Dave
Quoted 25 lines
--- contrib/virtiofsd/fuse_virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)contrib/virtiofsd/fuse_virtio.c +1
-1@@ -748,9 +748,9 @@ static void fv_queue_set_started(VuDev *dev, int qidx, bool started) }if (!vud->qi[qidx]) { vud->qi[qidx] =calloc (sizeof (struct fv_QueueInfo ),1 ); +assert (vud->qi[qidx]); vud->qi[qidx]->virtio_dev = vud; vud->qi[qidx]->qidx = qidx; -assert (vud->qi[qidx]); }else {/* Shouldn't have been started */ assert (vud->qi[qidx]->kick_fd ==-1 );Signature · 4 lines
_______________________________________________ Virtio-fs mailing list [email protected] https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK