xen/gntdev: remove redundant non-zero check on ret
The non-zero check on ret is always going to be false because ret was initialized as zero and the only place it is set to non-zero contains a return path before the non-zero check. Hence the check is redundant and can be removed. [ jgross@suse.com: limit scope of ret ] Addresses-Coverity: ("Logically dead code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
This commit is contained in:

committed by
Juergen Gross

parent
348be43384
commit
d41b26d81a
@@ -506,7 +506,6 @@ static const struct mmu_interval_notifier_ops gntdev_mmu_ops = {
|
|||||||
static int gntdev_open(struct inode *inode, struct file *flip)
|
static int gntdev_open(struct inode *inode, struct file *flip)
|
||||||
{
|
{
|
||||||
struct gntdev_priv *priv;
|
struct gntdev_priv *priv;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||||
if (!priv)
|
if (!priv)
|
||||||
@@ -518,17 +517,13 @@ static int gntdev_open(struct inode *inode, struct file *flip)
|
|||||||
#ifdef CONFIG_XEN_GNTDEV_DMABUF
|
#ifdef CONFIG_XEN_GNTDEV_DMABUF
|
||||||
priv->dmabuf_priv = gntdev_dmabuf_init(flip);
|
priv->dmabuf_priv = gntdev_dmabuf_init(flip);
|
||||||
if (IS_ERR(priv->dmabuf_priv)) {
|
if (IS_ERR(priv->dmabuf_priv)) {
|
||||||
ret = PTR_ERR(priv->dmabuf_priv);
|
int ret = PTR_ERR(priv->dmabuf_priv);
|
||||||
|
|
||||||
kfree(priv);
|
kfree(priv);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ret) {
|
|
||||||
kfree(priv);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
flip->private_data = priv;
|
flip->private_data = priv;
|
||||||
#ifdef CONFIG_XEN_GRANT_DMA_ALLOC
|
#ifdef CONFIG_XEN_GRANT_DMA_ALLOC
|
||||||
priv->dma_dev = gntdev_miscdev.this_device;
|
priv->dma_dev = gntdev_miscdev.this_device;
|
||||||
|
Reference in New Issue
Block a user