Explorar o código

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>
Parth Y Shah %!s(int64=7) %!d(string=hai) anos
pai
achega
b83a4141f0
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      drivers/misc/eeprom/max6875.c

+ 2 - 1
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 */