Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755696AbeAOQF1 (ORCPT + 1 other); Mon, 15 Jan 2018 11:05:27 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:48326 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755523AbeAOQFZ (ORCPT ); Mon, 15 Jan 2018 11:05:25 -0500 Date: Mon, 15 Jan 2018 17:05:22 +0100 From: Ladislav Michl To: SF Markus Elfring Cc: linux-omap@vger.kernel.org, Lee Jones , Tony Lindgren , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 1/3] mfd/omap-usb-tll: Delete two error messages for a failed memory allocation in usbtll_omap_probe() Message-ID: <20180115160522.GA2672@lenoch> References: <7719b4e7-1081-6fa4-6f14-f45cf062482d@users.sourceforge.net> <20180115134101.GA6711@lenoch> <1ebb5ac5-aa4d-7c19-94db-210b518d562f@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1ebb5ac5-aa4d-7c19-94db-210b518d562f@users.sourceforge.net> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Marcus, On Mon, Jan 15, 2018 at 04:38:43PM +0100, SF Markus Elfring wrote: > >> @@ -258,7 +256,6 @@ static int usbtll_omap_probe(struct platform_device *pdev) > >> GFP_KERNEL); > >> if (!tll->ch_clk) { > >> ret = -ENOMEM; > >> - dev_err(dev, "Couldn't allocate memory for channel clocks\n"); > > > > I'd either leave this one, just to know which allocation failed or better use > > something like this … > > Are you aware on the structure for a Linux allocation failure report? Just created one (not OMAP and not this driver, but that does not matter now): ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at mm/slab_common.c:1012 kmalloc_slab+0x38/0xdc Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0-rc7-next-20180115 #25 Hardware name: Atmel AT91SAM9 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (__warn+0xcc/0xe4) [] (__warn) from [] (warn_slowpath_null+0x38/0x44) [] (warn_slowpath_null) from [] (kmalloc_slab+0x38/0xdc) [] (kmalloc_slab) from [] (__kmalloc_track_caller+0xc/0xb0) [] (__kmalloc_track_caller) from [] (devm_kmalloc+0x1c/0x58) [] (devm_kmalloc) from [] (max9867_i2c_probe+0x1c/0xe0) [] (max9867_i2c_probe) from [] (i2c_device_probe+0x270/0x298) [] (i2c_device_probe) from [] (driver_probe_device+0x2b4/0x458) [] (driver_probe_device) from [] (__driver_attach+0x7c/0xec) [] (__driver_attach) from [] (bus_for_each_dev+0x58/0x7c) [] (bus_for_each_dev) from [] (bus_add_driver+0x1a8/0x220) [] (bus_add_driver) from [] (driver_register+0xa0/0xe0) [] (driver_register) from [] (i2c_register_driver+0x74/0xa0) [] (i2c_register_driver) from [] (do_one_initcall+0x134/0x15c) [] (do_one_initcall) from [] (kernel_init_freeable+0x178/0x1b4) [] (kernel_init_freeable) from [] (kernel_init+0x8/0x100) [] (kernel_init) from [] (ret_from_fork+0x14/0x34) Exception stack(0xc381bfb0 to 0xc381bff8) bfa0: 00000000 00000000 00000000 00000000 bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 3c79eadf2363e939 ]--- max9867: probe of 1-0018 failed with error -12 driver was instructed to alloc insane number of bytes using devm_kzalloc in max9867_i2c_probe. Now, if probe function calls devm_kzalloc two times and one of them fails, you cannot easily say which one without looking at assembly listing. Or did I misunderstand your question? Best regards, ladis