* [PATCH] wireless: marvell: add checks for the return value of sysfs_create_group
@ 2018-12-26 3:43 Kangjie Lu
[not found] ` <20181226034305.73411-1-kjlu-OJFnDUYgAso@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Kangjie Lu @ 2018-12-26 3:43 UTC (permalink / raw)
To: kjlu
Cc: pakki001, Kalle Valo, David S. Miller, libertas-dev,
linux-wireless, netdev, linux-kernel
sysfs_create_group() could fail, so let's check its return values and
issue error messages if it fails.
Signed-off-by: Kangjie Lu <kjlu@umn•edu>
---
drivers/net/wireless/marvell/libertas/mesh.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c
index b0cb16ef8d1d..90b20618e0af 100644
--- a/drivers/net/wireless/marvell/libertas/mesh.c
+++ b/drivers/net/wireless/marvell/libertas/mesh.c
@@ -797,7 +797,11 @@ static void lbs_persist_config_init(struct net_device *dev)
{
int ret;
ret = sysfs_create_group(&(dev->dev.kobj), &boot_opts_group);
+ if (ret)
+ pr_err("failed to create boot_opts_group.\n");
ret = sysfs_create_group(&(dev->dev.kobj), &mesh_ie_group);
+ if (ret)
+ pr_err("failed to create mesh_ie_group.\n");
}
static void lbs_persist_config_remove(struct net_device *dev)
--
2.17.2 (Apple Git-113)
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <20181226034305.73411-1-kjlu-OJFnDUYgAso@public.gmane.org>]
* Re: [PATCH] wireless: marvell: add checks for the return value of sysfs_create_group [not found] ` <20181226034305.73411-1-kjlu-OJFnDUYgAso@public.gmane.org> @ 2019-01-08 16:46 ` Kalle Valo 2019-01-08 17:42 ` [PATCH v2] libertas: " Kangjie Lu 0 siblings, 1 reply; 4+ messages in thread From: Kalle Valo @ 2019-01-08 16:46 UTC (permalink / raw) To: Kangjie Lu Cc: pakki001-OJFnDUYgAso, David S. Miller, libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Kangjie Lu <kjlu-OJFnDUYgAso@public•gmane.org> writes: > sysfs_create_group() could fail, so let's check its return values and > issue error messages if it fails. > > Signed-off-by: Kangjie Lu <kjlu-OJFnDUYgAso@public•gmane.org> > --- > drivers/net/wireless/marvell/libertas/mesh.c | 4 ++++ The correct prefix is "libertas: ". https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#commit_title_is_wrong > --- a/drivers/net/wireless/marvell/libertas/mesh.c > +++ b/drivers/net/wireless/marvell/libertas/mesh.c > @@ -797,7 +797,11 @@ static void lbs_persist_config_init(struct net_device *dev) > { > int ret; > ret = sysfs_create_group(&(dev->dev.kobj), &boot_opts_group); > + if (ret) > + pr_err("failed to create boot_opts_group.\n"); Please add an empty line here for readability and resend the patch as v2. > ret = sysfs_create_group(&(dev->dev.kobj), &mesh_ie_group); > + if (ret) > + pr_err("failed to create mesh_ie_group.\n"); > } > > static void lbs_persist_config_remove(struct net_device *dev) -- Kalle Valo ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] libertas: add checks for the return value of sysfs_create_group 2019-01-08 16:46 ` Kalle Valo @ 2019-01-08 17:42 ` Kangjie Lu 2019-02-01 12:06 ` Kalle Valo 0 siblings, 1 reply; 4+ messages in thread From: Kangjie Lu @ 2019-01-08 17:42 UTC (permalink / raw) To: kjlu Cc: pakki001, Kalle Valo, David S. Miller, libertas-dev, linux-wireless, netdev, linux-kernel sysfs_create_group() could fail. The fix checkes its return values and issue error messages if it fails. Signed-off-by: Kangjie Lu <kjlu@umn•edu> --- drivers/net/wireless/marvell/libertas/mesh.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c index b0cb16ef8d1d..2315fdff56c2 100644 --- a/drivers/net/wireless/marvell/libertas/mesh.c +++ b/drivers/net/wireless/marvell/libertas/mesh.c @@ -797,7 +797,12 @@ static void lbs_persist_config_init(struct net_device *dev) { int ret; ret = sysfs_create_group(&(dev->dev.kobj), &boot_opts_group); + if (ret) + pr_err("failed to create boot_opts_group.\n"); + ret = sysfs_create_group(&(dev->dev.kobj), &mesh_ie_group); + if (ret) + pr_err("failed to create mesh_ie_group.\n"); } static void lbs_persist_config_remove(struct net_device *dev) -- 2.17.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] libertas: add checks for the return value of sysfs_create_group 2019-01-08 17:42 ` [PATCH v2] libertas: " Kangjie Lu @ 2019-02-01 12:06 ` Kalle Valo 0 siblings, 0 replies; 4+ messages in thread From: Kalle Valo @ 2019-02-01 12:06 UTC (permalink / raw) To: Kangjie Lu Cc: kjlu, pakki001, David S. Miller, libertas-dev, linux-wireless, netdev, linux-kernel Kangjie Lu <kjlu@umn•edu> wrote: > sysfs_create_group() could fail. The fix checkes its return values > and issue error messages if it fails. > > Signed-off-by: Kangjie Lu <kjlu@umn•edu> Patch applied to wireless-drivers-next.git, thanks. 434256833d8e libertas: add checks for the return value of sysfs_create_group -- https://patchwork.kernel.org/patch/10752631/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-01 12:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-26 3:43 [PATCH] wireless: marvell: add checks for the return value of sysfs_create_group Kangjie Lu
[not found] ` <20181226034305.73411-1-kjlu-OJFnDUYgAso@public.gmane.org>
2019-01-08 16:46 ` Kalle Valo
2019-01-08 17:42 ` [PATCH v2] libertas: " Kangjie Lu
2019-02-01 12:06 ` Kalle Valo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox