diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-03-11 21:45:34 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-11 10:14:35 -0700 |
commit | 59691367be00806a3ab1c6a125ced6ed87e91356 (patch) | |
tree | da3b2b089d805d32ed27fe0146709da11bc557c1 | |
parent | 70c1e91f5b43327eca9941205c529ba43ddc7923 (diff) |
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>
-rw-r--r-- | drivers/staging/android/sync.c | 2 |
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); |