lkml.org 
[lkml]   [2012]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v5 2/2] Regulator: Add Anatop regulator driver
    On Thu, Mar 01, 2012 at 05:10:52PM +0800, Ying-Chun Liu (PaulLiu) wrote:

    > + if (IS_ERR(rdev)) {
    > + dev_err(&pdev->dev, "failed to register %s\n",
    > + rdesc->name);
    > + kfree(rdesc->name);
    > + return PTR_ERR(rdev);
    > + }
    > +
    > + return 0;
    > +}
    > +
    > +int anatop_regulator_remove(struct platform_device *pdev)
    > +{
    > + struct regulator_dev *rdev = platform_get_drvdata(pdev);
    > + regulator_unregister(rdev);
    > + return 0;

    Looks mostly good but this leaks rdesc->name which was allocated with
    kstrdup() in the probe() function.
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2012-03-01 12:19    [W:0.019 / U:62.708 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site