提交 8658a6a5 编写于 作者: P Paul Fertser 提交者: Zheng Zengkai

hwmon: (pmbus/pxe1610) don't bail out when not all pages are active

stable inclusion
from stable-5.10.37
commit 816fbc17cbe8e666a861fc637771d19a69b6de12
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit f0253143 ]

Certain VRs might be configured to use only the first output channel and
so the mode for the second will be 0. Handle this gracefully.

Fixes: b9fa0a3a ("hwmon: (pmbus/core) Add support for vid mode detection per page bases")
Signed-off-by: NPaul Fertser <fercerpav@gmail.com>
Link: https://lore.kernel.org/r/20210416102926.13614-1-fercerpav@gmail.comSigned-off-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 308f0690
......@@ -41,6 +41,15 @@ static int pxe1610_identify(struct i2c_client *client,
info->vrm_version[i] = vr13;
break;
default:
/*
* If prior pages are available limit operation
* to them
*/
if (i != 0) {
info->pages = i;
return 0;
}
return -ENODEV;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册