lkml.org 
[lkml]   [2020]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] hwmon: (ina3221) Fix reference count leak in ina3221_write_enable
    Date
    ina3221_write_enable() calls pm_runtime_get_sync() that increments
    the reference counter. In case of failure, decrement the reference
    count and return the error.

    Signed-off-by: Aditya Pakki <pakki001@umn.edu>
    ---
    drivers/hwmon/ina3221.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
    index f335d0cb0c77..9a3b46160de1 100644
    --- a/drivers/hwmon/ina3221.c
    +++ b/drivers/hwmon/ina3221.c
    @@ -492,6 +492,7 @@ static int ina3221_write_enable(struct device *dev, int channel, bool enable)
    ret = pm_runtime_get_sync(ina->pm_dev);
    if (ret < 0) {
    dev_err(dev, "Failed to get PM runtime\n");
    + pm_runtime_put_sync(ina->pm_dev);
    return ret;
    }
    }
    --
    2.25.1
    \
     
     \ /
      Last update: 2020-06-14 05:38    [W:4.374 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site