lkml.org 
[lkml]   [2012]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] drivers/atm/solos-pci.c: exchange pci_iounmaps
    Date
    From: Julia Lawall <Julia.Lawall@lip6.fr>

    The calls to pci_iounmap are in the wrong order, as compared to the
    associated calls to pci_iomap.

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

    // <smpl>
    @@
    expression e,x;
    statement S,S1;
    int ret;
    @@
    e = pci_iomap(x,...)
    ... when != pci_iounmap(x,e)
    if (<+...e...+>) S
    ... when any
    when != pci_iounmap(x,e)
    *if (...)
    { ... when != pci_iounmap(x,e)
    return ...; }
    ... when any
    pci_iounmap(x,e);
    // </smpl>

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

    ---
    drivers/atm/solos-pci.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
    index 5d1d076..e8cd652 100644
    --- a/drivers/atm/solos-pci.c
    +++ b/drivers/atm/solos-pci.c
    @@ -1206,9 +1206,9 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)

    out_unmap_both:
    pci_set_drvdata(dev, NULL);
    - pci_iounmap(dev, card->config_regs);
    - out_unmap_config:
    pci_iounmap(dev, card->buffers);
    + out_unmap_config:
    + pci_iounmap(dev, card->config_regs);
    out_release_regions:
    pci_release_regions(dev);
    out:


    \
     
     \ /
      Last update: 2012-02-19 20:45    [W:4.931 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site