Skip to content

Commit

Permalink
misc: eeprom: assignment outside the if statement
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Parth Y Shah authored and Greg Kroah-Hartman committed Aug 5, 2018
1 parent f019f07 commit b83a414
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/misc/eeprom/max6875.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit b83a414

Please sign in to comment.