Skip to content

Commit a0e244e

Browse files
Dan Carpentergregkh
authored andcommitted
staging: vc04_services: Delete unnecessary NULL check
The "state" pointer points to an offset in the middle of the "mgmt" struct so it can't possibly be NULL. And also we dereferenced it on the line before. So this NULL check is pointless. Delete it. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Stefan Wahren <wahrenst@gmx.net> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Link: https://lore.kernel.org/r/526ec2ff-6277-4d5d-b2d9-63b087a97c7c@moroto.mountain Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 62cbabc commit a0e244e

File tree

1 file changed

+0
-5
lines changed
  • drivers/staging/vc04_services/interface/vchiq_arm

1 file changed

+0
-5
lines changed

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,11 +1170,6 @@ static int vchiq_open(struct inode *inode, struct file *file)
11701170

11711171
dev_dbg(state->dev, "arm: vchiq open\n");
11721172

1173-
if (!state) {
1174-
dev_err(state->dev, "arm: vchiq has no connection to VideoCore\n");
1175-
return -ENOTCONN;
1176-
}
1177-
11781173
instance = kzalloc(sizeof(*instance), GFP_KERNEL);
11791174
if (!instance)
11801175
return -ENOMEM;

0 commit comments

Comments
 (0)