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:	Tue, 29 Nov 2011 23:36:52 +0200
From:	Artem Bityutskiy <dedekind1@...il.com>
To:	b35362@...escale.com
Cc:	dwmw2@...radead.org, Artem.Bityutskiy@...ia.com,
	r58472@...escale.com, linux-kernel@...r.kernel.org,
	linux-mtd@...ts.infradead.org, scottwood@...escale.com,
	akpm@...ux-foundation.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2] Integrated Flash Controller support

On Mon, 2011-10-31 at 17:38 +0800, b35362@...escale.com wrote:
> +/*
> + * fsl_ifc_ctrl_probe
> + *
> + * called by device layer when it finds a device matching
> + * one our driver can handled. This code allocates all of
> + * the resources needed for the controller only.  The
> + * resources for the NAND banks themselves are allocated
> + * in the chip probe function.
> +*/
> +static int __devinit fsl_ifc_ctrl_probe(struct platform_device *dev)
> +{
> +	int ret = 0;
> +
> +

... snip ...

I am concerned about the error path in this function

> +	init_waitqueue_head(&fsl_ifc_ctrl_dev->nand_wait);
> +
> +	ret = request_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_irq, IRQF_SHARED,
> +			  "fsl-ifc", fsl_ifc_ctrl_dev);
> +	if (ret != 0) {
> +		dev_err(&dev->dev, "failed to install irq (%d)\n",
> +			fsl_ifc_ctrl_dev->irq);
> +		goto err;
> +	}

irq_dispose_mapping() on error path?

> +
> +	ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq, 0,
> +			  "fsl-ifc-nand", fsl_ifc_ctrl_dev);
> +	if (ret != 0) {
> +		dev_err(&dev->dev, "failed to install irq (%d)\n",
> +			fsl_ifc_ctrl_dev->nand_irq);
> +		goto err;

free_irq() on error path?
> +	}
> +
> +	return 0;
> +
> +err:
> +	return ret;
> +}


> +static __init int fsl_ifc_init(void)
> +{
> +	int ret;
> +
> +	ret = platform_driver_register(&fsl_ifc_ctrl_driver);
> +	if (ret)
> +		printk(KERN_ERR "fsl-ifc: Failed to register platform"
> +				"driver\n");
> +
> +	return ret;
> +}
> +
> +static void __exit fsl_ifc_exit(void)
> +{
> +	platform_driver_unregister(&fsl_ifc_ctrl_driver);
> +}
> +
> +module_init(fsl_ifc_init);
> +module_exit(fsl_ifc_exit);

How about using module_platform_driver() instead?


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