linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-omap@vger.kernel.org, Lee Jones <lee.jones@linaro.org>,
	Tony Lindgren <tony@atomide.com>,
	LKML <linux-kernel@vger.kernel.org>,
	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()
Date: Mon, 15 Jan 2018 17:05:22 +0100	[thread overview]
Message-ID: <20180115160522.GA2672@lenoch> (raw)
In-Reply-To: <1ebb5ac5-aa4d-7c19-94db-210b518d562f@users.sourceforge.net>

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
[<c0107950>] (unwind_backtrace) from [<c010565c>] (show_stack+0x10/0x14)
[<c010565c>] (show_stack) from [<c010f6cc>] (__warn+0xcc/0xe4)
[<c010f6cc>] (__warn) from [<c010f7a4>] (warn_slowpath_null+0x38/0x44)
[<c010f7a4>] (warn_slowpath_null) from [<c018ef90>] (kmalloc_slab+0x38/0xdc)
[<c018ef90>] (kmalloc_slab) from [<c01a5494>] (__kmalloc_track_caller+0xc/0xb0)
[<c01a5494>] (__kmalloc_track_caller) from [<c02fe5a8>] (devm_kmalloc+0x1c/0x58)
[<c02fe5a8>] (devm_kmalloc) from [<c03f96ec>] (max9867_i2c_probe+0x1c/0xe0)
[<c03f96ec>] (max9867_i2c_probe) from [<c038a708>] (i2c_device_probe+0x270/0x298)
[<c038a708>] (i2c_device_probe) from [<c02fb37c>] (driver_probe_device+0x2b4/0x458)
[<c02fb37c>] (driver_probe_device) from [<c02fb59c>] (__driver_attach+0x7c/0xec)
[<c02fb59c>] (__driver_attach) from [<c02f9840>] (bus_for_each_dev+0x58/0x7c)
[<c02f9840>] (bus_for_each_dev) from [<c02fa7cc>] (bus_add_driver+0x1a8/0x220)
[<c02fa7cc>] (bus_add_driver) from [<c02fbe7c>] (driver_register+0xa0/0xe0)
[<c02fbe7c>] (driver_register) from [<c038aa6c>] (i2c_register_driver+0x74/0xa0)
[<c038aa6c>] (i2c_register_driver) from [<c0102570>] (do_one_initcall+0x134/0x15c)
[<c0102570>] (do_one_initcall) from [<c0700da8>] (kernel_init_freeable+0x178/0x1b4)
[<c0700da8>] (kernel_init_freeable) from [<c050122c>] (kernel_init+0x8/0x100)
[<c050122c>] (kernel_init) from [<c01010e0>] (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

  reply	other threads:[~2018-01-15 16:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 13:14 [PATCH 0/3] mfd/omap-usb-tll: Adjustments for usbtll_omap_probe() SF Markus Elfring
2018-01-15 13:15 ` [PATCH 1/3] mfd/omap-usb-tll: Delete two error messages for a failed memory allocation in usbtll_omap_probe() SF Markus Elfring
2018-01-15 13:41   ` Ladislav Michl
2018-01-15 15:34     ` Roger Quadros
2018-01-15 15:38     ` SF Markus Elfring
2018-01-15 16:05       ` Ladislav Michl [this message]
2018-01-15 16:21         ` [1/3] " SF Markus Elfring
2018-01-15 16:35           ` Ladislav Michl
2018-01-15 17:06             ` SF Markus Elfring
2018-01-15 17:41               ` Ladislav Michl
2018-01-15 18:12                 ` SF Markus Elfring
2018-01-15 18:30                   ` Ladislav Michl
2018-01-15 19:04                     ` mfd/omap-usb-tll: Allocate driver data at once " SF Markus Elfring
2018-01-15 19:23                       ` Ladislav Michl
2018-01-15 19:40                         ` SF Markus Elfring
2018-01-15 19:26                     ` SF Markus Elfring
2018-01-15 19:33                       ` Ladislav Michl
2018-01-15 13:16 ` [PATCH 2/3] mfd/omap-usb-tll: Improve a size determination " SF Markus Elfring
2018-01-22 15:50   ` Lee Jones
2018-01-15 13:17 ` [PATCH 3/3] mfd/omap-usb-tll: Return an error code only as a constant " SF Markus Elfring
2018-01-22 15:50   ` Lee Jones
2018-01-23 13:04     ` Lee Jones
2018-01-23 14:43       ` [3/3] " SF Markus Elfring
2018-01-23 15:04         ` Lee Jones
2018-01-23 17:13           ` Ladislav Michl
2018-01-24 15:16             ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180115160522.GA2672@lenoch \
    --to=ladis@linux-mips.org \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).