From: Roel Kluin <roel.kluin@gmail.com>
To: linux-s390@vger.kernel.org
Subject: [PATCH] lcs_start_kernel_thread(): handle kernel_thread failure
Date: Fri, 19 Dec 2008 22:30:50 +0000 [thread overview]
Message-ID: <494C209A.1030400@gmail.com> (raw)
kernel_thread may fail, notice this.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/s390/net/lcs.c | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 0825be8..3b6f287 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1736,14 +1736,27 @@ lcs_stopcard(struct lcs_card *card)
static void
lcs_start_kernel_thread(struct work_struct *work)
{
+ int retval;
struct lcs_card *card = container_of(work, struct lcs_card, kernel_thread_starter);
LCS_DBF_TEXT(5, trace, "krnthrd");
- if (lcs_do_start_thread(card, LCS_RECOVERY_THREAD))
- kernel_thread(lcs_recovery, (void *) card, SIGCHLD);
+ if (lcs_do_start_thread(card, LCS_RECOVERY_THREAD)) {
+ retval = kernel_thread(lcs_recovery, card, SIGCHLD);
+ if (retval < 0) {
+ dev_err(&card->dev->dev,
+ "Creating LCS recovery thread failed.\n");
+ return;
+ }
+ }
#ifdef CONFIG_IP_MULTICAST
- if (lcs_do_start_thread(card, LCS_SET_MC_THREAD))
- kernel_thread(lcs_register_mc_addresses,
- (void *) card, SIGCHLD);
+ if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) {
+ retval = kernel_thread(lcs_register_mc_addresses, card,
+ SIGCHLD);
+ if (retval < 0) {
+ dev_err(&card->dev->dev,
+ "Creating LCS multicast address failed.\n");
+ return;
+ }
+ }
#endif
}
reply other threads:[~2008-12-19 22:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=494C209A.1030400@gmail.com \
--to=roel.kluin@gmail.com \
--cc=linux-s390@vger.kernel.org \
/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