public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Ardo <bjorn.ardo@axis.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: <linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<patrick@stwcx.xyz>, <kernel@axis.com>
Subject: Re: [PATCHv2] i2c: slave-eeprom: Make it possible to pre-load eeprom data
Date: Fri, 24 Apr 2020 13:22:14 +0200	[thread overview]
Message-ID: <5038e4c1-440b-0a56-978b-a8c9fac061cc@axis.com> (raw)
In-Reply-To: <20200424111337.GC1959@kunai>

On 4/24/20 1:13 PM, Wolfram Sang wrote:

> On second look, two questions:
>
>> +	if (!error) {
>> +		int ret = request_firmware_into_buf(&fw, eeprom_data, &client->dev,
>> +						    eeprom->buffer, size);
>> +		if (ret)
>> +			return ret;
> Aren't we leaking 'fw' here?


As I can see in drivers/base/firmware_loader/main.c in function 
_request_firmware, then the fw will be released internally if it returns 
an error value.


> Also, do we need 'error' and 'ret'? Can't we reuse one of them?


Yes, I can fix that.


/BA


  reply	other threads:[~2020-04-24 11:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  9:04 [PATCHv2] i2c: slave-eeprom: Make it possible to pre-load eeprom data Björn Ardö
2020-04-24 10:03 ` Wolfram Sang
2020-04-24 10:06   ` Bjorn Ardo
2020-04-24 15:32     ` Patrick Williams
2020-04-24 11:13 ` Wolfram Sang
2020-04-24 11:22   ` Bjorn Ardo [this message]
2020-04-24 11:27     ` Wolfram Sang
2020-04-24 11:31       ` Bjorn Ardo
  -- strict thread matches above, loose matches on Subject: below --
2020-04-24 11:29 Björn Ardö

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=5038e4c1-440b-0a56-978b-a8c9fac061cc@axis.com \
    --to=bjorn.ardo@axis.com \
    --cc=kernel@axis.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrick@stwcx.xyz \
    --cc=wsa@the-dreams.de \
    /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