lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Jul 2011 08:44:53 +0800
From:	Axel Lin <axel.lin@...il.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	linux-kernel@...r.kernel.org, Liam Girdwood <lrg@...com>
Subject: Re: [PATCH] regulator: Fix memory leak in set_machine_constraints()
 error paths

2011/7/15 Mark Brown <broonie@...nsource.wolfsonmicro.com>:
> On Thu, Jul 14, 2011 at 09:29:19PM +0800, Axel Lin wrote:
>>  static int set_machine_constraints(struct regulator_dev *rdev,
>>       const struct regulation_constraints *constraints)
>>  {
>> -     int ret = 0;
>> +     int ret;
>>       struct regulator_ops *ops = rdev->desc->ops;
>>
>
> This doesn't look like a leak fix?  There's nothing that checks for
> other errors here (like null pointers)?
>

I think it does checking null pointer for rdev->constraints in current
implementation:

static int set_machine_constraints(struct regulator_dev *rdev,
        const struct regulation_constraints *constraints)
{
        int ret;
        struct regulator_ops *ops = rdev->desc->ops;

        rdev->constraints = kmemdup(constraints, sizeof(*constraints),
                                    GFP_KERNEL);
        if (!rdev->constraints)
                return -ENOMEM;


Regards,
Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ