Thread (13 messages) 13 messages, 2 authors, 2014-10-22

Re: [PATCH net-next 1/6] ethernet: wiznet: remove unnecessary check

From: Varka Bhadram <hidden>
Date: 2014-10-22 12:26:39

On 10/22/2014 05:13 PM, Sergei Shtylyov wrote:
Hello.

On 10/22/2014 8:16 AM, Varka Bhadram wrote:
quoted
devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.
quoted
Signed-off-by: Varka Bhadram <redacted>
---
  drivers/net/ethernet/wiznet/w5100.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
quoted
diff --git a/drivers/net/ethernet/wiznet/w5100.c 
b/drivers/net/ethernet/wiznet/w5100.c
index 0f56b1c..bf195e3 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -638,8 +638,7 @@ static int w5100_hw_probe(struct platform_device 
*pdev)
      }

      mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-    if (!mem)
-        return -ENXIO;
+
      mem_size = resource_size(mem);
   This would cause a NULL dereference on resource_size() call if 
'mem' is NULL. You can't remove the NULL check because of that.
Ok i will fix it . Thankx for the review.
quoted
      priv->base = devm_ioremap_resource(&pdev->dev, mem);
WBR, Sergei

-- 
Regards,
Varka Bhadram.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help