Commit bc2d4dbe authored by Zhen Lei's avatar Zhen Lei Committed by sanglipeng
Browse files

genirq: Fix the return type of kstat_cpu_irqs_sum()

stable inclusion
from stable-v5.10.173
commit a4935bb734448a71e4eae539b1d7768f6ed134ac
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8BFR3

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a4935bb734448a71e4eae539b1d7768f6ed134ac



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

[ Upstream commit 47904aed ]

The type of member ->irqs_sum is unsigned long, but kstat_cpu_irqs_sum()
returns int, which can result in truncation.  Therefore, change the
kstat_cpu_irqs_sum() function's return value to unsigned long to avoid
truncation.

Fixes: f2c66cd8 ("/proc/stat: scalability of irq num per cpu")
Reported-by: default avatarElliott, Robert (Servers) <elliott@hpe.com>
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Josh Don <joshdon@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent a8500543
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment