[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210616035109.GA25873@lst.de>
Date: Wed, 16 Jun 2021 05:51:10 +0200
From: Christoph Hellwig <hch@....de>
To: Kees Cook <keescook@...omium.org>
Cc: linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>,
Al Viro <viro@...iv.linux.org.uk>, gmpy.liaowx@...il.com,
Anton Vorontsov <anton@...msg.org>,
Colin Cross <ccross@...roid.com>,
Tony Luck <tony.luck@...el.com>,
Jonathan Corbet <corbet@....net>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
linux-doc@...r.kernel.org, linux-mtd@...ts.infradead.org,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v2 1/4] pstore/blk: Improve failure reporting
On Tue, Jun 15, 2021 at 02:21:18PM -0700, Kees Cook wrote:
> - if (!dev || !dev->total_size || !dev->read || !dev->write)
> + if (!dev || !dev->total_size || !dev->read || !dev->write) {
> + if (!dev)
> + pr_err("NULL device info\n");
> + else {
> + if (!dev->total_size)
> + pr_err("zero sized device\n");
> + if (!dev->read)
> + pr_err("no read handler for device\n");
> + if (!dev->write)
> + pr_err("no write handler for device\n");
> + }
> return -EINVAL;
> + }
I still find this style of checks pretty strange..
Powered by blists - more mailing lists