提交 c99776cc 编写于 作者: A Aditya Pakki 提交者: Takashi Iwai

ALSA: ice1712: fix a missing check of snd_i2c_sendbytes

snd_i2c_sendbytes could fail. The fix checks its return value: if it
fails, issues an error message and returns with its error code.
Signed-off-by: NAditya Pakki <pakki001@umn.edu>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 0f25e000
......@@ -826,7 +826,12 @@ static int snd_ice1712_6fire_read_pca(struct snd_ice1712 *ice, unsigned char reg
snd_i2c_lock(ice->i2c);
byte = reg;
snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1);
if (snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1)) {
snd_i2c_unlock(ice->i2c);
dev_err(ice->card->dev, "cannot send pca\n");
return -EIO;
}
byte = 0;
if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) {
snd_i2c_unlock(ice->i2c);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册