summaryrefslogtreecommitdiffstats
path: root/drivers/misc/eeprom
diff options
context:
space:
mode:
authorParth Y Shah <sparth1292@gmail.com>2018-08-03 11:20:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-05 16:25:10 +0200
commitb83a4141f025388fd1edeaa48789e3e166e95c7a (patch)
tree35db37e65b6876367364b454ef317f352714c577 /drivers/misc/eeprom
parentuio: potential double frees if __uio_register_device() fails (diff)
downloadlinux-b83a4141f025388fd1edeaa48789e3e166e95c7a.tar.xz
linux-b83a4141f025388fd1edeaa48789e3e166e95c7a.zip
misc: eeprom: assignment outside the if statement
Assignment of any variable should be kept outside the if statement Signed-off-by: Parth Y Shah <sparth1292@gmail.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/eeprom')
-rw-r--r--drivers/misc/eeprom/max6875.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c
index 0e32709d1022..fc0cf9a7402e 100644
--- a/drivers/misc/eeprom/max6875.c
+++ b/drivers/misc/eeprom/max6875.c
@@ -148,7 +148,8 @@ static int max6875_probe(struct i2c_client *client,
if (client->addr & 1)
return -ENODEV;
- if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL)))
+ data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL);
+ if (!data)
return -ENOMEM;
/* A fake client is created on the odd address */