lkml.org 
[lkml]   [2014]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6/8] adm8211: fix error return code
    Date
    Return a negative error code on failure.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    // <smpl>
    @@
    identifier ret; expression e1,e2;
    @@
    (
    if (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    // </smpl>

    Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

    ---
    drivers/net/wireless/adm8211.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
    index 17fcaab..f07a618 100644
    --- a/drivers/net/wireless/adm8211.c
    +++ b/drivers/net/wireless/adm8211.c
    @@ -1837,6 +1837,7 @@ static int adm8211_probe(struct pci_dev *pdev,
    if (!priv->map) {
    printk(KERN_ERR "%s (adm8211): Cannot map device memory\n",
    pci_name(pdev));
    + err = -ENOMEM;
    goto err_free_dev;
    }



    \
     
     \ /
      Last update: 2014-12-29 18:21    [W:4.277 / U:0.168 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site