Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1646212
| Path | csiph.com!news.freedyn.net!open-news-network.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] init: Delete an error message for a failed memory allocation in rd_load_image() |
| Date | Sat, 20 May 2017 22:30:01 +0200 |
| Message-ID | <tJjaF-6ex-1@gated-at.bofh.it> (permalink) |
| X-Original-To | Nicolas Schichan <nicolas.schichan@gmail.com>, kernel-janitors@vger.kernel.org |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Language | en-GB |
| Content-Transfer-Encoding | 7bit |
| X-Provags-ID | V03:K0:dTWeizLQyUji4q0COKCr74jgSOps9LrIVUOtCuMKsXZgsTlUdXi yZn8SGizVj+mjlW9lJGIOGsKt0wOABEmEaVoRxlgrB9jGsXei/mei4WuVYfYbDmWD7foje9 Ja9RQK0jKFAW8qGvPlDLeCFUg10czKOgTYIxPR+G9uWfcsZBZRzRtxrhCA7+5NoGJPxGD4S XC9g+jDzpMu2Yo83EuXtg== |
| X-Ui-Out-Filterresults | notjunk:1;V01:K0:gI7e4ukJ/vI=:YivL7dSGQXspMMkT2e285S Sxt+3zgRSLEXDlWhMS59BGdUivuPternPmfkJ7XDrwpZwRHR0ygwmb8tAviFXReKf8iz8E2q/ Qqo6EmhMx9wBmr8F6LpRboVCyPaW4lRdGVwYBPQe71p9rc5zQO9o0Mgvln1slAn7U1Cczeypl h4criQk6g6lS55vgAHylHik8BlBm38ChthytcPLmXbpyPlNfr54UrsAIH46pe/54sWN85XVvv OyAm6LVi6aHIcaVmKjcABlEw1Eb123uvY8M24Obqf/abf89gF+I1rjjSHjzsiKWM33t33I1q5 Vn+nTf8sYPQI0ZnJMORM0NaSFqvzPcIri/I24FqKIkdpMkAChFvytKTS+6zLOAW5ozxhfflrw BTYFivYCP6AvByBxUWoh2kqJ5fh3ozDB9SqsjswUZmYuJFurs6FsS5+POcjyDRQOOd8Bhz41F GsA/rCNaPL9vnik2JvSuAfqw/k7RPNa+pOfwNOShnkwPMRU++Uh3OQozN27yj9+GXH+CH0If9 wxQwAqbCIQ5I3qJykrm0/zKiBFIoZrbdETFv1w81b56TtD+V0nV6eis/qIp3GPgMEQAJWQJ+L rr3Jap1XpexVRy/g7fBhBu8I9mlZAzvmCfaxEsU14dvIIRAypgaGMm5KDeQYF+uYcchRgVWZd mpL6Q9uQ4srTeu+cdEQ5sjG8ikODKxtpvTzDFWL2eOVa2TRRYoGW9pkYSnyrUwAZMtWZA+2Yi X1oDN7hXBgUtSpPrsh8au8/bxXekklu/lfgVG7kkfMS5RaUcjJ/ZGWes5qwNKPnGSVxnNRPna 2oJQ6J0 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 31 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | LKML <linux-kernel@vger.kernel.org>, Wolfram Sang <wsa@the-dreams.de> |
| X-Original-Date | Sat, 20 May 2017 22:20:37 +0200 |
| X-Original-Message-ID | <b08e4c5c-0d6e-ae13-5c5d-a4860e8199eb@users.sourceforge.net> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1646212 |
Show key headers only | View raw
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 20 May 2017 22:14:36 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
init/do_mounts_rd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index dd4104c9aa12..47cafb189ad3 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -245,10 +245,8 @@ int __init rd_load_image(char *from)
}
buf = kmalloc(BLOCK_SIZE, GFP_KERNEL);
- if (!buf) {
- printk(KERN_ERR "RAMDISK: could not allocate buffer\n");
+ if (!buf)
goto done;
- }
printk(KERN_NOTICE "RAMDISK: Loading %dKiB [%ld disk%s] into ram disk... ",
nblocks, ((nblocks-1)/devblocks)+1, nblocks>devblocks ? "s" : "");
--
2.13.0
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] init: Delete an error message for a failed memory allocation in rd_load_image() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 22:30 +0200
csiph-web