public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Aditya Pakki <pakki001@umn.edu>
Cc: Oder Chiou <oder_chiou@realtek.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	kjlu@umn.edu, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Bard Liao <bardliao@realtek.com>
Subject: Re: [PATCH] ASoC: rt5663: Fix error handling of device_property_read_u32_array
Date: Mon, 7 Jan 2019 16:04:59 +0000	[thread overview]
Message-ID: <20190107160459.GI9570@sirena.org.uk> (raw)
In-Reply-To: <20190105134427.1022-1-pakki001@umn.edu>


[-- Attachment #1.1: Type: text/plain, Size: 619 bytes --]

On Sat, Jan 05, 2019 at 07:44:27AM -0600, Aditya Pakki wrote:

>  		rt5663->imp_table = devm_kzalloc(dev, table_size, GFP_KERNEL);
> -		device_property_read_u32_array(dev,
> +		return device_property_read_u32_array(dev,
>  			"realtek,impedance_sensing_table",
>  			(u32 *)rt5663->imp_table, table_size);

This is going to silently fail without giving any indication of what's
wrong which isn't great - it's not clear that completely failing to load
the driver is the best option here, and even if it is we should probably
tell the user what went wrong.

We're also not checking the result of the memory allocation...

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



      reply	other threads:[~2019-01-07 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-05 13:44 [PATCH] ASoC: rt5663: Fix error handling of device_property_read_u32_array Aditya Pakki
2019-01-07 16:04 ` Mark Brown [this message]

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=20190107160459.GI9570@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=kjlu@umn.edu \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=pakki001@umn.edu \
    --cc=tiwai@suse.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