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, 15 Nov 2010 08:45:56 +0100
From:	Marco Stornelli <marco.stornelli@...il.com>
To:	yidong zhang <zhangyd6@...il.com>
Cc:	linux-embedded@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, tim.bird@...sony.com,
	akpm@...ux-foundation.org
Subject: Re: [PATCH 02/16 v3] pramfs: super operations

2010/11/15 yidong zhang <zhangyd6@...il.com>:
> hi Marco
>
>> +       retval = 0;
>> + out:
>> +       if (retval && sbi->virt_addr) {
>> +               iounmap(sbi->virt_addr);
>> +               release_mem_region(sbi->phys_addr, initsize);
>> +               kfree(sbi);
>> +       }
>> +
>> +       return retval;
>> +}
>> +
>  I think kfree(sbi) should not be put here. In case of
> pram_parse_options failure, sbi should also be freed too.  How about
> change it to the list below? And change some “goto out”   branches to
> “goto out_free”.
>
>  //    retval = 0;
>     return 0;
>  out:
>        if (retval && sbi->virt_addr) {
>                iounmap(sbi->virt_addr);
>                release_mem_region(sbi->phys_addr, initsize);
>        }
> out_free:
>                kfree(sbi);
>        return retval;
> }
>

Yeah, you're right. It's not always true that virt addr is valid,
kfree should be used out of this if. I'll fix it.

Marco
--
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