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] [day] [month] [year] [list]
Date:   Mon, 31 Jul 2017 19:25:17 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Anton Vasilyev <vasilyev@...ras.ru>
Cc:     Colin Ian King <colin.king@...onical.com>,
        Jiri Kosina <jkosina@...e.cz>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        ldv-project@...uxtesting.org
Subject: Re: [PATCH] misc: Return error on error path

On Mon, Jul 31, 2017 at 6:48 PM, Anton Vasilyev <vasilyev@...ras.ru> wrote:
> If ibmasm_event_buffer_init() or ibmasm_heartbeat_init() fails,
> then ibmasm_init_one() release all resources and return 0 on error path.
>
> The patch adds corresponding error for fails.
>
> Found by Linux Driver Verification project (linuxtesting.org).

To me looks better to

- return 1;
+ return -ENOMEM;

in event.c, and then...

>         if (ibmasm_event_buffer_init(sp)) {
>                 dev_err(sp->dev, "Failed to allocate event buffer\n");
> +               result = -ENOMEM;
>                 goto error_eventbuffer;
>         }

result = ibmasm_event_buffer_init(sp);
if (result) {
 ...
}

>         if (ibmasm_heartbeat_init(sp)) {
>                 dev_err(sp->dev, "Failed to allocate heartbeat command\n");
> +               result = -ENOMEM;
>                 goto error_heartbeat;
>         }

Ditto.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ