[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1284900914-24728-1-git-send-email-segooon@gmail.com>
Date: Sun, 19 Sep 2010 16:55:14 +0400
From: Vasiliy Kulikov <segooon@...il.com>
To: kernel-janitors@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...e.de>,
Martyn Welch <martyn.welch@...com>,
Bill Pemberton <wfp5p@...ginia.edu>, Tejun Heo <tj@...nel.org>,
Huang Weiyi <weiyi.huang@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 12/14] staging: vme: fix device_register() error handling
If device_register() fails then call put_device().
See comment to device_register.
Signed-off-by: Vasiliy Kulikov <segooon@...il.com>
---
compile tested.
drivers/staging/vme/vme.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 093fbff..c08668d 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -1357,8 +1357,10 @@ int vme_register_bridge(struct vme_bridge *bridge)
dev_set_name(dev, "vme-%x.%x", bridge->num, i + 1);
retval = device_register(dev);
- if (retval)
+ if (retval) {
+ put_device(dev);
goto err_reg;
+ }
}
return retval;
--
1.7.0.4
--
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