Skip to contentSkip to conversation

staging: davinci_vpfe: fix error check

PATCH In review Levente Kurusa 3 participants 3 messages Feb 15, 2014 – Feb 18, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: davinci_vpfe: fix error check

The check would check the pointer, which is never less than 0. According to the error message, the correct check would be to check the return value of ipipe_mode. Check that instead.

---
 drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +1 -1
index 2d36b60..b2daf5e 100644
@@ -267,7 +267,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe)
 	}
 
 	ipipe_mode = get_ipipe_mode(ipipe);
-	if (ipipe < 0) {
+	if (ipipe_mode < 0) {
 		pr_err("Failed to get ipipe mode");
 		return -EINVAL;
 	}
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Levente Kurusa

The check would check the pointer, which is never less than 0. According to the error message, the correct check would be to check the return value of ipipe_mode. Check that instead.

Quoted 19 lines
 drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +1 -1
index 2d36b60..b2daf5e 100644
@@ -267,7 +267,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe)
 	}
 
 	ipipe_mode = get_ipipe_mode(ipipe);
-	if (ipipe < 0) {
+	if (ipipe_mode < 0) {
 		pr_err("Failed to get ipipe mode");
 		return -EINVAL;
 	}
Signature · 1 line
1.8.3.1
#2 lore raw

Hi Prabhakar,

(Removing Greg, Mauro and the [email protected] list to avoid spamming them)

Quoted 9 lines · On Saturday 15 February 2014 09:16:19 Josh Triplett wrote:
Quoted 6 lines · Levente Kurusa

The check would check the pointer, which is never less than 0. According to the error message, the correct check would be to check the return value of ipipe_mode. Check that instead.

Could you please handle this patch ?

Quoted 18 lines
Quoted 18 lines
 drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c index 2d36b60..b2daf5e 100644

drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +1 -1
@@ -267,7 +267,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe)
 
 	}
 
 	ipipe_mode = get_ipipe_mode(ipipe);
-	if (ipipe < 0) {
+	if (ipipe_mode < 0) {
 		pr_err("Failed to get ipipe mode");
 		return -EINVAL;

}

Signature · 3 lines
Regards,

Laurent Pinchart