Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1269949 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2015-11-16 10:50 +0100 |
| Last post | 2015-11-16 10:50 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 0/2] mISDN: Deletion of an unnecessary check SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-16 10:50 +0100
[PATCH 2/2] mISDN: One function call less in mISDN_sock_sendmsg() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-16 10:50 +0100
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2015-11-16 10:50 +0100 |
| Subject | [PATCH 0/2] mISDN: Deletion of an unnecessary check |
| Message-ID | <qvoAb-5D7-25@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 16 Nov 2015 10:40:11 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Delete an unnecessary check before the function call "kfree_skb" One function call less in mISDN_sock_sendmsg() after error detection drivers/isdn/mISDN/socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2015-11-16 10:50 +0100 |
| Subject | [PATCH 2/2] mISDN: One function call less in mISDN_sock_sendmsg() after error detection |
| Message-ID | <qvoAa-5D7-23@gated-at.bofh.it> |
| In reply to | #1269949 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Nov 2015 10:30:29 +0100
The kfree_skb() function was called in one case by the
mISDN_sock_sendmsg() function during error handling even if a call of
the _l2_alloc_skb() function returned a null pointer.
This implementation detail could be improved by the introduction
of another jump label.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/isdn/mISDN/socket.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index edd16ef..430ac8c 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -200,7 +200,7 @@ mISDN_sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
skb = _l2_alloc_skb(len, GFP_KERNEL);
if (!skb)
- goto done;
+ goto release_socket;
if (memcpy_from_msg(skb_put(skb, len), msg, len)) {
err = -EFAULT;
@@ -237,6 +237,7 @@ mISDN_sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
done:
kfree_skb(skb);
+release_socket:
release_sock(sk);
return err;
}
--
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web