Re: [PATCH] drivers:block:mtip32xx:mtip32xx:change the order of null-pointer dereference validation

From: kbuild test robot
Date: Wed Apr 26 2017 - 13:09:00 EST


Hi Heloise,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.11-rc8 next-20170426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Heloise/drivers-block-mtip32xx-mtip32xx-change-the-order-of-null-pointer-dereference-validation/20170426-235410
config: x86_64-acpi-redef (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

drivers/block/mtip32xx/mtip32xx.c: In function 'mtip_async_complete':
>> drivers/block/mtip32xx/mtip32xx.c:234:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
struct driver_data *dd = port->dd;
^~~~~~

vim +234 drivers/block/mtip32xx/mtip32xx.c

8f8b8995 Asai Thambi S P 2013-09-11 218 * clears the allocated bit associated with the completed command.
8f8b8995 Asai Thambi S P 2013-09-11 219 *
8f8b8995 Asai Thambi S P 2013-09-11 220 * @port Pointer to the port data structure.
8f8b8995 Asai Thambi S P 2013-09-11 221 * @tag Tag of the command.
8f8b8995 Asai Thambi S P 2013-09-11 222 * @data Pointer to driver_data.
8f8b8995 Asai Thambi S P 2013-09-11 223 * @status Completion status.
8f8b8995 Asai Thambi S P 2013-09-11 224 *
8f8b8995 Asai Thambi S P 2013-09-11 225 * return value
8f8b8995 Asai Thambi S P 2013-09-11 226 * None
8f8b8995 Asai Thambi S P 2013-09-11 227 */
8f8b8995 Asai Thambi S P 2013-09-11 228 static void mtip_async_complete(struct mtip_port *port,
ffc771b3 Jens Axboe 2014-05-09 229 int tag, struct mtip_cmd *cmd, int status)
8f8b8995 Asai Thambi S P 2013-09-11 230 {
6a63892e Heloise 2017-04-25 231 if (unlikely(!port))
6a63892e Heloise 2017-04-25 232 return;
6a63892e Heloise 2017-04-25 233
ffc771b3 Jens Axboe 2014-05-09 @234 struct driver_data *dd = port->dd;
ffc771b3 Jens Axboe 2014-05-09 235 struct request *rq;
8f8b8995 Asai Thambi S P 2013-09-11 236
6a63892e Heloise 2017-04-25 237 if (unlikely(!dd))
8f8b8995 Asai Thambi S P 2013-09-11 238 return;
8f8b8995 Asai Thambi S P 2013-09-11 239
8f8b8995 Asai Thambi S P 2013-09-11 240 if (unlikely(status == PORT_IRQ_TF_ERR)) {
8f8b8995 Asai Thambi S P 2013-09-11 241 dev_warn(&port->dd->pdev->dev,
8f8b8995 Asai Thambi S P 2013-09-11 242 "Command tag %d failed due to TFE\n", tag);

:::::: The code at line 234 was first introduced by commit
:::::: ffc771b3ca8b2c03e5e9faa6335b4862108f111f mtip32xx: convert to use blk-mq

:::::: TO: Jens Axboe <axboe@xxxxxx>
:::::: CC: Jens Axboe <axboe@xxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip