Re: [PATCH] mtd: fsl-quadspi: possible NULL reference

From: kbuild test robot
Date: Mon Nov 16 2015 - 14:47:27 EST


Hi Brian,

[auto build test WARNING on mtd/master]
[also build test WARNING on v4.4-rc1 next-20151116]

url: https://github.com/0day-ci/linux/commits/Brian-Norris/mtd-fsl-quadspi-possible-NULL-reference/20151117-024430
base: git://git.infradead.org/linux-mtd.git master
config: i386-allmodconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_probe':
>> drivers/mtd/spi-nor/fsl-quadspi.c:947:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
q->devtype_data = of_device_get_match_data(dev);
^

vim +/const +947 drivers/mtd/spi-nor/fsl-quadspi.c

931 struct device *dev = &pdev->dev;
932 struct fsl_qspi *q;
933 struct resource *res;
934 struct spi_nor *nor;
935 struct mtd_info *mtd;
936 int ret, i = 0;
937
938 q = devm_kzalloc(dev, sizeof(*q), GFP_KERNEL);
939 if (!q)
940 return -ENOMEM;
941
942 q->nor_num = of_get_child_count(dev->of_node);
943 if (!q->nor_num || q->nor_num > FSL_QSPI_MAX_CHIP)
944 return -ENODEV;
945
946 q->dev = dev;
> 947 q->devtype_data = of_device_get_match_data(dev);
948 if (!q->devtype_data)
949 return -ENODEV;
950 platform_set_drvdata(pdev, q);
951
952 /* find the resources */
953 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "QuadSPI");
954 q->iobase = devm_ioremap_resource(dev, res);
955 if (IS_ERR(q->iobase))

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

Attachment: .config.gz
Description: Binary data