aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/android
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-03-11 21:45:34 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-11 10:14:35 -0700
commit59691367be00806a3ab1c6a125ced6ed87e91356 (patch)
treeda3b2b089d805d32ed27fe0146709da11bc557c1 /drivers/staging/android
parentstaging: comedi: remove duplicated include from ni_pcimio.c (diff)
downloadlinux-dev-59691367be00806a3ab1c6a125ced6ed87e91356.tar.xz
linux-dev-59691367be00806a3ab1c6a125ced6ed87e91356.zip
staging: sync: fix return value check in sync_fence_alloc()
In case of error, the function anon_inode_getfile() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android')
-rw-r--r--drivers/staging/android/sync.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index b9bb974faacd..bf66c199a833 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -261,7 +261,7 @@ static struct sync_fence *sync_fence_alloc(const char *name)
fence->file = anon_inode_getfile("sync_fence", &sync_fence_fops,
fence, 0);
- if (fence->file == NULL)
+ if (IS_ERR(fence->file))
goto err;
kref_init(&fence->kref);