Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751471AbbH0PiT (ORCPT ); Thu, 27 Aug 2015 11:38:19 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:35818 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbbH0PiR convert rfc822-to-8bit (ORCPT ); Thu, 27 Aug 2015 11:38:17 -0400 From: Michal Nazarewicz To: Alexander Kuleshov , Andrew Morton , Joonsoo Kim , Sasha Levin , Stefan Strogin , Dmitry Safonov Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexander Kuleshov Subject: Re: [PATCH] mm/cma_debug: Check return value of the debugfs_create_dir() In-Reply-To: <1440489154-3470-1-git-send-email-kuleshovmail@gmail.com> Organization: http://mina86.com/ References: <1440489154-3470-1-git-send-email-kuleshovmail@gmail.com> User-Agent: Notmuch/0.19+53~g2e63a09 (http://notmuchmail.org) Emacs/25.0.50.1 (x86_64-unknown-linux-gnu) X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd;KFrfMCylc}gc??'U2j,!8%xdD Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:150827:akpm@linux-foundation.org::DOygB6517wxezWHB:00000000000000000000000000000000000003T5 X-Hashcash: 1:20:150827:kuleshovmail@gmail.com::K/dhGTzv6XgIInfQ:0000000000000000000000000000000000000000pwp X-Hashcash: 1:20:150827:linux-mm@kvack.org::b++L0m1uHGm7/3+k:00000000000000000000000000000000000000000000/ee X-Hashcash: 1:20:150827:stefan.strogin@gmail.com::tXsmrxUbMHd2DMLl:000000000000000000000000000000000000026v9 X-Hashcash: 1:20:150827:kuleshovmail@gmail.com::bDR+ZSVoeVpALbV4:0000000000000000000000000000000000000005M+o X-Hashcash: 1:20:150827:linux-kernel@vger.kernel.org::PukIHkhiGDK1agLr:0000000000000000000000000000000007Exx X-Hashcash: 1:20:150827:d.safonov@partner.samsung.com::n3/8UhPL3keZKLFL:000000000000000000000000000000008kqY X-Hashcash: 1:20:150827:sasha.levin@oracle.com::s2BWP7CM2tAHEqOP:000000000000000000000000000000000000000CDC9 X-Hashcash: 1:20:150827:js1304@gmail.com::JUbnJMBBNGkkL/Oo:0CSd6 Date: Thu, 27 Aug 2015 17:38:13 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1350 Lines: 40 On Tue, Aug 25 2015, Alexander Kuleshov wrote: > The debugfs_create_dir() function may fail and return error. If the > root directory not created, we can't create anything inside it. This > patch adds check for this case. > > Signed-off-by: Alexander Kuleshov I’d also add a pr_warn but otherwise: Acked-by: Michal Nazarewicz > --- > mm/cma_debug.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/cma_debug.c b/mm/cma_debug.c > index f8e4b60..bfb46e2 100644 > --- a/mm/cma_debug.c > +++ b/mm/cma_debug.c > @@ -171,6 +171,9 @@ static void cma_debugfs_add_one(struct cma *cma, int idx) > > tmp = debugfs_create_dir(name, cma_debugfs_root); > > + if (!tmp) > + return; > + > debugfs_create_file("alloc", S_IWUSR, tmp, cma, > &cma_alloc_fops); > -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, ミハウ “mina86” ナザレヴイツ (o o) ooo +---------ooO--(_)--Ooo-- -- 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/