DPDK patches and discussions
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@mellanox.com>
To: gaetan.rivet@6wind.com
Cc: dev@dpdk.org, matan@mellanox.com, thomas@monjalon.net,
	ophirmu@mellanox.com, rasland@mellanox.com
Subject: [dpdk-dev] [PATCH] net/failsafe: fix starting failsafe with invalid MAC
Date: Mon,  7 May 2018 15:17:15 +0300	[thread overview]
Message-ID: <1525695435-14917-1-git-send-email-rasland@mellanox.com> (raw)

When starting failsafe with mac option, and giving it an invalid MAC. It
will cause a segmentation fault due to the hotplug_alarm installed on an
invalid subdev.

Fixes: a46f8d58 ("net/failsafe: add fail-safe PMD")
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
---
 drivers/net/failsafe/failsafe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 5e7a8ba..3a747c2 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -226,7 +226,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
 							       mac);
 			if (ret) {
 				ERROR("Failed to set default MAC address");
-				goto free_args;
+				goto cancel_alarm;
 			}
 		}
 	} else {
@@ -260,6 +260,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
 		.type = RTE_INTR_HANDLE_EXT,
 	};
 	return 0;
+cancel_alarm:
+	failsafe_hotplug_alarm_cancel(dev);
 free_args:
 	failsafe_args_free(dev);
 free_subs:
-- 
2.7.4

             reply	other threads:[~2018-05-07 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 12:17 Raslan Darawsheh [this message]
2018-05-09 11:46 ` Gaëtan Rivet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1525695435-14917-1-git-send-email-rasland@mellanox.com \
    --to=rasland@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    --cc=matan@mellanox.com \
    --cc=ophirmu@mellanox.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).