Patchwork [Open-FCoE] fcoemon: fixup log_nlmsg_error()

login
register
mail settings
Submitter Hannes Reinecke
Date June 30, 2016, 8:37 a.m.
Message ID <1467275832-11467-1-git-send-email-hare@suse.de>
Download mbox | patch
Permalink /patch/323/
State New
Headers show

Comments

Hannes Reinecke - June 30, 2016, 8:37 a.m.
The error message is in the data, not the next message.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 fcoemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/fcoemon.c b/fcoemon.c
index d84d1e5..158ee68 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -755,7 +755,7 @@  static void log_nlmsg_error(struct nlmsghdr *hp, size_t rlen, const char *str)
 	struct nlmsgerr *ep;
 
 	if (NLMSG_OK(hp, rlen)) {
-		ep = (struct nlmsgerr *)NLMSG_NEXT(hp, rlen);
+		ep = (struct nlmsgerr *)NLMSG_DATA(hp);
 		FCM_LOG_DBG("%s, err=%d, type=%d\n",
 			    str, ep->error, ep->msg.nlmsg_type);
 	} else {