From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752298AbdHOL7A (ORCPT ); Tue, 15 Aug 2017 07:59:00 -0400 Received: from mout.web.de ([212.227.15.14]:59867 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbdHOL66 (ORCPT ); Tue, 15 Aug 2017 07:58:58 -0400 Subject: [PATCH 1/5] net/9p: Delete an error message for a failed memory allocation in five functions From: SF Markus Elfring To: v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, "David S. Miller" , Eric Van Hensbergen , Latchesar Ionkov , Ron Minnich Cc: LKML , kernel-janitors@vger.kernel.org References: <22a44d7c-cdb9-e206-4b2c-56e38cbf0de1@users.sourceforge.net> Message-ID: Date: Tue, 15 Aug 2017 13:58:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <22a44d7c-cdb9-e206-4b2c-56e38cbf0de1@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:fj2xeT0ZurJIJd7Ukfum+O8Tn4tB7N4fE/8QMzhom/bXXdooHi1 bmwzHjDSWOuDmDTbJpF2qdYTewN5u6ebX3TV0UfPP9lSEpZOTWrco+NIWLJE8N/x0xrQAO4 9WPmnICilKavTd/9xIrZZiUYL4LtU9tHimeuY5I8J4bsiAsi81+a4HW4LysgzNwwdu2caCv Tk3FJK0u0L3iXzmAq+Mug== X-UI-Out-Filterresults: notjunk:1;V01:K0:yZdO76Xu7WA=:HDlSpi9eRRBKPyrMy1etO6 rayCxWjN9jB7bnx5xFMIfMN1HBjxcmpSw7XaMMRNZLIeV513G0C5me2umAHjURUi+5HMi0P8O EQKjeCq+kke6KSvWt+MPsE8LzdJdjgSioMSNq3gMdggr0rjw50FdKQ53TGZEYVutGgUJ1X0Tt W8EMbC50HsRMBpEWlmebFi3NxVhhiNEiVickwGMRGN7twyFG1yXvP18DlTO+/f52TD/7Jb7AR X2ac7fRYKLN/9tGewKervbVCWNwa6evsR80+ovtcJDUBo4gtYH6h7nXC7dHWtvoFTHr50W6Kq 6gMtrpQrFVt07VMQ3MIu9QzK6+Ro72Lzn1rSpQ8BKuc2GfO/2iJPz/CLzNDHDE0JjF+5DAqIx DyRoR2hj8PmBoeR9AfPRtdF5bWl8J1UX0XdStUTbr+Wbqcndtei8YcAEEkqiioI+UTGVtwfn+ 4kUgG0ofw417XwN+dluK2VmpN6uMKJ9mrL5NwcWI0zy3cXlYbiYFt5HU7YmZf4lVgAf3vb5Ux w6JbSgrCqXXaryu1RJu2Cn6e7lhbLihz9XHPpeNdlLkwU4Uw8sS0kCKChmSqeeh/4hjHRCpYE LllrIGox8ajXopp9cB9WvNzxo/ybLZh37HL5XYtJxC2LvBUI0KrTDYHg5ZeN43SF+ornClnv9 Oi0b1Gk+eT0EU5DPRGvyHrh7zayOUVWid3LUbGzZELyFn+9qYo+VfJ1JIMRElLas5i4DlHR9b Pqk7aA/iF1ivI5IHBp9h85j0gaRrYTzG4ZlhU4cOVER+j19uuj9QkKCo1jcnc4zP+MtE+FxYS yJ9lkcqsX68OJw2+NW1+xvtYgykcuwDBKGH0+BQ3VCIXNK54wQ= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Tue, 15 Aug 2017 08:25:41 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- net/9p/client.c | 7 ++----- net/9p/trans_fd.c | 6 ++---- net/9p/trans_rdma.c | 6 ++---- net/9p/trans_virtio.c | 1 - 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/net/9p/client.c b/net/9p/client.c index 4674235b0d9b..2273181e9ba9 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -160,11 +160,9 @@ static int parse_opts(char *opts, struct p9_client *clnt) return 0; tmp_options = kstrdup(opts, GFP_KERNEL); - if (!tmp_options) { - p9_debug(P9_DEBUG_ERROR, - "failed to allocate copy of option string\n"); + if (!tmp_options) return -ENOMEM; - } + options = tmp_options; while ((p = strsep(&options, ",")) != NULL) { @@ -277,7 +275,6 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size) sizeof(struct p9_req_t), GFP_ATOMIC); if (!c->reqs[row]) { - pr_err("Couldn't grow tag array\n"); spin_unlock_irqrestore(&c->lock, flags); return ERR_PTR(-ENOMEM); } diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index ddfa86648f95..3c272e5bc9ea 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -762,11 +762,9 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) return 0; tmp_options = kstrdup(params, GFP_KERNEL); - if (!tmp_options) { - p9_debug(P9_DEBUG_ERROR, - "failed to allocate copy of option string\n"); + if (!tmp_options) return -ENOMEM; - } + options = tmp_options; while ((p = strsep(&options, ",")) != NULL) { diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 6d8e3031978f..f98b6aae308b 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -205,11 +205,9 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts) return 0; tmp_options = kstrdup(params, GFP_KERNEL); - if (!tmp_options) { - p9_debug(P9_DEBUG_ERROR, - "failed to allocate copy of option string\n"); + if (!tmp_options) return -ENOMEM; - } + options = tmp_options; while ((p = strsep(&options, ",")) != NULL) { diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index f24b25c25106..8a2cf9748398 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -552,7 +552,6 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan = kmalloc(sizeof(struct virtio_chan), GFP_KERNEL); if (!chan) { - pr_err("Failed to allocate virtio 9P channel\n"); err = -ENOMEM; goto fail; } -- 2.14.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Tue, 15 Aug 2017 11:58:36 +0000 Subject: [PATCH 1/5] net/9p: Delete an error message for a failed memory allocation in five functions Message-Id: List-Id: References: <22a44d7c-cdb9-e206-4b2c-56e38cbf0de1@users.sourceforge.net> In-Reply-To: <22a44d7c-cdb9-e206-4b2c-56e38cbf0de1@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, "David S. Miller" , Eric Van Hensbergen , Latchesar Ionkov , Ron Minnich Cc: LKML , kernel-janitors@vger.kernel.org From: Markus Elfring Date: Tue, 15 Aug 2017 08:25:41 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- net/9p/client.c | 7 ++----- net/9p/trans_fd.c | 6 ++---- net/9p/trans_rdma.c | 6 ++---- net/9p/trans_virtio.c | 1 - 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/net/9p/client.c b/net/9p/client.c index 4674235b0d9b..2273181e9ba9 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -160,11 +160,9 @@ static int parse_opts(char *opts, struct p9_client *clnt) return 0; tmp_options = kstrdup(opts, GFP_KERNEL); - if (!tmp_options) { - p9_debug(P9_DEBUG_ERROR, - "failed to allocate copy of option string\n"); + if (!tmp_options) return -ENOMEM; - } + options = tmp_options; while ((p = strsep(&options, ",")) != NULL) { @@ -277,7 +275,6 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size) sizeof(struct p9_req_t), GFP_ATOMIC); if (!c->reqs[row]) { - pr_err("Couldn't grow tag array\n"); spin_unlock_irqrestore(&c->lock, flags); return ERR_PTR(-ENOMEM); } diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index ddfa86648f95..3c272e5bc9ea 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -762,11 +762,9 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) return 0; tmp_options = kstrdup(params, GFP_KERNEL); - if (!tmp_options) { - p9_debug(P9_DEBUG_ERROR, - "failed to allocate copy of option string\n"); + if (!tmp_options) return -ENOMEM; - } + options = tmp_options; while ((p = strsep(&options, ",")) != NULL) { diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 6d8e3031978f..f98b6aae308b 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -205,11 +205,9 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts) return 0; tmp_options = kstrdup(params, GFP_KERNEL); - if (!tmp_options) { - p9_debug(P9_DEBUG_ERROR, - "failed to allocate copy of option string\n"); + if (!tmp_options) return -ENOMEM; - } + options = tmp_options; while ((p = strsep(&options, ",")) != NULL) { diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index f24b25c25106..8a2cf9748398 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -552,7 +552,6 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan = kmalloc(sizeof(struct virtio_chan), GFP_KERNEL); if (!chan) { - pr_err("Failed to allocate virtio 9P channel\n"); err = -ENOMEM; goto fail; } -- 2.14.0