Skip to contentSkip to conversation

drivers/extcon/extcon-max8997.c:436:6: warning: 'ret' may be used uninitialized

PATCH New [email protected] 1 participant 1 message Jul 9, 2012 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 39/66 drivers/extcon/extcon-max8997.c:436:6: warning: 'ret' may be used uninitialized

Hi Chanwoo,

There are new compile warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git for-next
head:   c6a5d9ff6f96128161126c0a01f0a28edf8010da
commit: dca1a71e4108a0a9051a653d885297e9d1cc656c [39/66] extcon: Add support irq domain for MAX8997 muic

All warnings:

drivers/extcon/extcon-max8997.c: In function 'max8997_muic_probe':
drivers/extcon/extcon-max8997.c:436:6: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

vim +436 drivers/extcon/extcon-max8997.c
433 struct max8997_dev *max8997 = dev_get_drvdata(pdev->dev.parent);
434 struct max8997_platform_data *pdata = dev_get_platdata(max8997->dev);
435 struct max8997_muic_info *info;

Quoted 1 line

436 int ret, i;

437
438 info = kzalloc(sizeof(struct max8997_muic_info), GFP_KERNEL);
439 if (!info) {

'ret' is uninitialized in this branch:

+ virq = irq_create_mapping(max8997->irq_domain, muic_irq->irq);
+ if (!virq)
+ goto err_irq;

---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu <[email protected]> Intel Corporation