From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751500AbbIKDJu (ORCPT ); Thu, 10 Sep 2015 23:09:50 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:2683 "EHLO mx0a-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbbIKDJs (ORCPT ); Thu, 10 Sep 2015 23:09:48 -0400 From: Xiaolong Ye To: , , , , , CC: Xiaolong Ye Subject: [PATCH] fix incorrect initialization code for trans_stat of devfreq Date: Fri, 11 Sep 2015 11:05:22 +0800 Message-ID: <1441940723-12360-1-git-send-email-yexl@marvell.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-09-11_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=inbound_notspam policy=inbound score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.9 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1509110046 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I met trans_stat abnormal issue while debugging devfreq feature for ddr in arm64 system, cat trans_stat would get extremely large time value which is unreasonable, I checked the code and found it was caused by incorrect initialization code, time_in_state is initialized by devm_kzalloc and wrongly use sizeof(unsigned int) as argument, but time_in_state which is defined in struct devfreq actually is defined as unsigned long, so it is ok for 32 bit system, but will cause unexpected result in 64 bit system. Xiaolong Ye (1): PM / devfreq: Fix incorrect type issue. drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5