lkml.org 
[lkml]   [2015]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Subjectsata_mv: Another source code review around exception handling?
    From
    Date
    Hello,

    I have looked at the source file for the Marvell SATA support driver once more.
    I would appreciate if a specific implementation detail can be clarified there.

    Static source code analysis can point out that functions like the following
    are called by the mv_platform_probe() function.
    https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/ata/sata_mv.c?id=80c75a0f1d81922bf322c0634d1e1a15825a89e6#n4055

    * ata_host_alloc_pinfo
    http://lxr.free-electrons.com/source/drivers/ata/libata-core.c?v=4.3#L5768

    * devm_kzalloc
    http://lxr.free-electrons.com/source/include/linux/device.h?v=4.3#L645


    The value "-ENOMEM" will be returned if one of these function calls failed.
    Can it be that any system resources (like memory) are not appropriately
    released if any calls of this sequence succeeded before the failure?


    Is the use of the single jump label "err" also suspicious here?

    Regards,
    Markus


    \
     
     \ /
      Last update: 2015-12-25 17:21    [W:4.018 / U:0.580 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site