Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9825d73c authored by Akinobu Mita's avatar Akinobu Mita Committed by Jeff Garzik
Browse files

[PATCH] ata: fix platform_device_register_simple() error check



The return value of platform_device_register_simple() should be checked
by IS_ERR().

Cc: Jeff Garzik <jgarzik@pobox.com>
Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 551c012d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -698,8 +698,10 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl
		goto fail_io;

	pdev = platform_device_register_simple(DRV_NAME, nr_legacy_host, NULL, 0);
	if (pdev == NULL)
	if (IS_ERR(pdev)) {
		ret = PTR_ERR(pdev);
		goto fail_dev;
	}

	if (ht6560a & mask) {
		ops = &ht6560a_port_ops;
+2 −2
Original line number Diff line number Diff line
@@ -247,8 +247,8 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i
	 */

	pdev = platform_device_register_simple(DRV_NAME, nr_qdi_host, NULL, 0);
	if (pdev == NULL)
		return -ENOMEM;
	if (IS_ERR(pdev))
		return PTR_ERR(pdev);

	memset(&ae, 0, sizeof(struct ata_probe_ent));
	INIT_LIST_HEAD(&ae.node);
+2 −2
Original line number Diff line number Diff line
@@ -206,8 +206,8 @@ static __init int winbond_init_one(unsigned long port)
			 */

			pdev = platform_device_register_simple(DRV_NAME, nr_winbond_host, NULL, 0);
			if (pdev == NULL)
				return -ENOMEM;
			if (IS_ERR(pdev))
				return PTR_ERR(pdev);

			memset(&ae, 0, sizeof(struct ata_probe_ent));
			INIT_LIST_HEAD(&ae.node);