linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: allow vendor dumpit to terminate by returning 0
@ 2020-07-20 14:50 Julian Squires
  0 siblings, 0 replies; only message in thread
From: Julian Squires @ 2020-07-20 14:50 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Julian Squires

Although it's likely that I'm misunderstanding the intended interface
for vendor command dumpit, I couldn't find any detailed documentation
on it, or examples of drivers implementing it, so I'm sending in this
patch hoping it will at least lead to clarification.

It seems to me that dumpit, like netlink_callback->dump, should signal
successful completion by returning 0.

Currently, that will just cause dumpit to be called again, possibly
many times until an error occurs.  Since skb->len is never going to be
0 by the time dumpit is called, the only way for dumpit to signal
completion is by returning an error.  If it returns a positive value,
the current message is cancelled, but that positive value is returned
and nl80211_vendor_cmd_dump gets called again.

Signed-off-by: Julian Squires <julian@cipht.net>
---
 net/wireless/nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 78442fc4fc01..229d48ccf57f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -13156,7 +13156,7 @@ static int nl80211_vendor_cmd_dump(struct sk_buff *skb,
 		if (err == -ENOBUFS || err == -ENOENT) {
 			genlmsg_cancel(skb, hdr);
 			break;
-		} else if (err) {
+		} else if (err <= 0) {
 			genlmsg_cancel(skb, hdr);
 			goto out;
 		}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-20 14:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 14:50 [PATCH] cfg80211: allow vendor dumpit to terminate by returning 0 Julian Squires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).