From: luanshi <zhangliguang@linux.alibaba.com>
To: james.morse@arm.com
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [V2 3/3] firmware: arm_sdei: clean up sdei_event_create()
Date: Thu, 16 Jan 2020 11:28:51 +0800 [thread overview]
Message-ID: <1579145331-78633-3-git-send-email-zhangliguang@linux.alibaba.com> (raw)
In-Reply-To: <1579145331-78633-1-git-send-email-zhangliguang@linux.alibaba.com>
Function sdei_event_find() is always called in sdei_event_create(), but
it is already called in sdei_event_register(). So we should remove some
needless sdei_event_find() calls.
Signed-off-by: Liguang Zhang <zhangliguang@linux.alibaba.com>
---
drivers/firmware/arm_sdei.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c
index f81c09e..79ae07c 100644
--- a/drivers/firmware/arm_sdei.c
+++ b/drivers/firmware/arm_sdei.c
@@ -271,15 +271,9 @@ static struct sdei_event *sdei_event_create(u32 event_num,
event->private_registered = regs;
}
- if (sdei_event_find(event_num)) {
- kfree(event->registered);
- kfree(event);
- event = ERR_PTR(-EBUSY);
- } else {
- spin_lock(&sdei_list_lock);
- list_add(&event->list, &sdei_list);
- spin_unlock(&sdei_list_lock);
- }
+ spin_lock(&sdei_list_lock);
+ list_add(&event->list, &sdei_list);
+ spin_unlock(&sdei_list_lock);
return event;
}
--
1.8.3.1
next prev parent reply other threads:[~2020-01-16 3:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 3:28 [V2 1/3] firmware: arm_sdei: fix possible deadlock luanshi
2020-01-16 3:28 ` [V2 2/3] firmware: arm_sdei: Removed multiple white lines luanshi
2020-02-14 18:32 ` James Morse
2020-01-16 3:28 ` luanshi [this message]
2020-02-14 18:32 ` [V2 1/3] firmware: arm_sdei: fix possible deadlock James Morse
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=1579145331-78633-3-git-send-email-zhangliguang@linux.alibaba.com \
--to=zhangliguang@linux.alibaba.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).