All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Colin King <colin.king@canonical.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Chris Packham <chris.packham@alliedtelesis.co.nz>,
	linux-rtc@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][V2][next] rtc: ds1307: check for failed memory allocation on wdt
Date: Fri, 03 Apr 2020 09:22:45 +0000	[thread overview]
Message-ID: <20200403092245.GR3683@piout.net> (raw)
In-Reply-To: <20200403084504.GZ2001@kadam>

On 03/04/2020 11:45:04+0300, Dan Carpenter wrote:
> On Thu, Apr 02, 2020 at 04:53:12PM +0200, Alexandre Belloni wrote:
> > 
> > As stated, I also prefer keeping the watchdog optional and ignore the
> > error.
> 
> Hopefully you aren't running out of memory on start up.  In current
> kernels small memory allocations like this never fail so it doesn't
> really affect runtime.  It only silences the NULL dereference static
> checker warning.
> 

Yes, so the

if (!wdt)
 return;

would be enough instead of introducing unnecessary error handling.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Colin King <colin.king@canonical.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Chris Packham <chris.packham@alliedtelesis.co.nz>,
	linux-rtc@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][V2][next] rtc: ds1307: check for failed memory allocation on wdt
Date: Fri, 3 Apr 2020 11:22:45 +0200	[thread overview]
Message-ID: <20200403092245.GR3683@piout.net> (raw)
In-Reply-To: <20200403084504.GZ2001@kadam>

On 03/04/2020 11:45:04+0300, Dan Carpenter wrote:
> On Thu, Apr 02, 2020 at 04:53:12PM +0200, Alexandre Belloni wrote:
> > 
> > As stated, I also prefer keeping the watchdog optional and ignore the
> > error.
> 
> Hopefully you aren't running out of memory on start up.  In current
> kernels small memory allocations like this never fail so it doesn't
> really affect runtime.  It only silences the NULL dereference static
> checker warning.
> 

Yes, so the

if (!wdt)
 return;

would be enough instead of introducing unnecessary error handling.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2020-04-03  9:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 13:52 [PATCH][V2][next] rtc: ds1307: check for failed memory allocation on wdt Colin King
2020-04-02 13:52 ` Colin King
2020-04-02 14:39 ` Guenter Roeck
2020-04-02 14:39   ` Guenter Roeck
2020-04-02 14:44 ` Guenter Roeck
2020-04-02 14:44   ` Guenter Roeck
2020-04-02 14:53   ` Alexandre Belloni
2020-04-02 14:53     ` Alexandre Belloni
2020-04-03  8:45     ` Dan Carpenter
2020-04-03  8:45       ` Dan Carpenter
2020-04-03  9:22       ` Alexandre Belloni [this message]
2020-04-03  9:22         ` Alexandre Belloni
2020-04-03 10:01         ` Colin Ian King
2020-04-03 10:01           ` Colin Ian King
2020-04-02 19:51 ` Chris Packham
2020-04-02 19:51   ` Chris Packham

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=20200403092245.GR3683@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.