Re: [PATCH v5 1/4] dmaengine: dw: platform: check nr_masters to be non-zero

From: kbuild test robot
Date: Thu Apr 21 2016 - 11:28:21 EST


Hi,

[auto build test WARNING on next-20160421]
[also build test WARNING on v4.6-rc4]
[cannot apply to robh/for-next asoc/for-next v4.6-rc4 v4.6-rc3 v4.6-rc2]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/Fixes-cleanups-in-dw_dmac-affects-on-few-subsystems/20160421-231541
config: i386-randconfig-x003-201616 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

drivers/dma/dw/platform.c: In function 'dw_probe':
>> drivers/dma/dw/platform.c:119:20: warning: 'pdata' may be used uninitialized in this function [-Wmaybe-uninitialized]
pdata->nr_masters = nr_masters;
^
drivers/dma/dw/platform.c:104:31: note: 'pdata' was declared here
struct dw_dma_platform_data *pdata;
^

vim +/pdata +119 drivers/dma/dw/platform.c

103 struct device_node *np = pdev->dev.of_node;
104 struct dw_dma_platform_data *pdata;
105 u32 tmp, arr[DW_DMA_MAX_NR_MASTERS];
106 u32 nr_masters;
107 u32 nr_channels;
108
109 if (!np) {
110 dev_err(&pdev->dev, "Missing DT data\n");
111 return NULL;
112 }
113
114 if (of_property_read_u32(np, "dma-masters", &nr_masters))
115 return NULL;
116 if (nr_masters < 1 || nr_masters > DW_DMA_MAX_NR_MASTERS)
117 return NULL;
118
> 119 pdata->nr_masters = nr_masters;
120
121 if (of_property_read_u32(np, "dma-channels", &nr_channels))
122 return NULL;
123
124 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
125 if (!pdata)
126 return NULL;
127

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

Attachment: .config.gz
Description: Binary data