提交 13c2bede 编写于 作者: G Gustavo A. R. Silva 提交者: Mauro Carvalho Chehab

media: radio: wl1273: add check on core->write() return value

Check return value from call to core->write(), so in case of
error print error message, jump to goto label fail and eventually
return.

Addresses-Coverity-ID: 1226943
Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: NHans Verkuil <hansverk@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 0a0c1b82
......@@ -610,10 +610,21 @@ static int wl1273_fm_start(struct wl1273_device *radio, int new_mode)
}
}
if (radio->rds_on)
if (radio->rds_on) {
r = core->write(core, WL1273_RDS_DATA_ENB, 1);
else
if (r) {
dev_err(dev, "%s: RDS_DATA_ENB ON fails\n",
__func__);
goto fail;
}
} else {
r = core->write(core, WL1273_RDS_DATA_ENB, 0);
if (r) {
dev_err(dev, "%s: RDS_DATA_ENB OFF fails\n",
__func__);
goto fail;
}
}
} else {
dev_warn(dev, "%s: Illegal mode.\n", __func__);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册