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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 16 Oct 2014 16:39:30 +0900 From: Jingoo Han <jg1.han@...sung.com> To: 'Michael Opdenacker' <michael.opdenacker@...e-electrons.com> Cc: andrew@...n.ch, ezequiel.garcia@...e-electrons.com, dwmw2@...radead.org, computersforpeace@...il.com, linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org, 'Jingoo Han' <jg1.han@...sung.com> Subject: Re: [PATCH v2] mtd: orion_nand: fix error code path in probe On Thursday, October 16, 2014 1:59 PM, Michael Opdenacker wrote: > > This replaces kzalloc() and ioremap() calls by devm_ functions > in the probe() routine, which automatically release the corresponding > resources when probe() fails or when the device is removed. > > This simplifies simplifies the error management code, and brings > the below improvements or changes: > > A. Fixing a bug reported by "make coccicheck": > > If "board = devm_kzalloc()" fails, the probe() function jumps > incorrectly to label "no_res" and therefore returns without > running iounmap(). > > B. Requesting the memory region > > Using devm_ioremap_resource() makes the probe() function request > the corresponding memory region before running ioremap(), as > it is supposed to do. > > C. Standardizing the error codes: > > The use of devm_ioremap_resource() changes the return value: > * -ENOMEM instead of -EIO in case of ioremap() failure, > * -EINVAL instead of -ENODEV in case of platform_get_resource() > failure. > > Signed-off-by: Michael Opdenacker <michael.opdenacker@...e-electrons.com> Reviewed-by: Jingoo Han <jg1.han@...sung.com> Best regards, Jingoo Han > --- > drivers/mtd/nand/orion_nand.c | 39 +++++++++++---------------------------- > 1 file changed, 11 insertions(+), 28 deletions(-) -- 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