Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d4456c7 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Konrad Rzeszutek Wilk
Browse files

block: xen-blkback: add null check to avoid null pointer dereference



Add null check before calling xen_blkif_put() to avoid potential
null pointer dereference.

Addresses-Coverity-ID: 1350942
Cc: Juergen Gross <jgross@suse.com>
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 89515d02
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -504,11 +504,13 @@ static int xen_blkbk_remove(struct xenbus_device *dev)

	dev_set_drvdata(&dev->dev, NULL);

	if (be->blkif)
	if (be->blkif) {
		xen_blkif_disconnect(be->blkif);

		/* Put the reference we set in xen_blkif_alloc(). */
		xen_blkif_put(be->blkif);
	}

	kfree(be->mode);
	kfree(be);
	return 0;