Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751991AbcDKHXA (ORCPT ); Mon, 11 Apr 2016 03:23:00 -0400 Received: from mail-by2on0094.outbound.protection.outlook.com ([207.46.100.94]:29099 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751780AbcDKHW6 convert rfc822-to-8bit (ORCPT ); Mon, 11 Apr 2016 03:22:58 -0400 From: "Wan, Vincent" To: Dan Carpenter , Joerg Roedel CC: "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "kernel-janitors@vger.kernel.org" , "Wan Zongshun (vw@iommu.org)" Subject: RE: [patch] iommu/amd: Signedness bug in acpihid_device_group() Thread-Topic: [patch] iommu/amd: Signedness bug in acpihid_device_group() Thread-Index: AQHRk8Hosez3eFtLy0eMEEhLee8yp5+EXd5g Date: Mon, 11 Apr 2016 07:22:52 +0000 Message-ID: References: <20160411071446.GB10739@mwanda> In-Reply-To: <20160411071446.GB10739@mwanda> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=none action=none header.from=amd.com; x-originating-ip: [210.13.97.168] x-ms-office365-filtering-correlation-id: 272649f9-bf85-4220-d8ee-08d361da1832 x-microsoft-exchange-diagnostics: 1;DM3PR1201MB1021;5:kSxcIqfNaOth1FYkIUtdaJD7c+AOEyaaNdZPBAR4S9fBVWHRQ75/w5Wk/fnIz2xcRqRuHb2Qjyr5Zjm1h/2/bbVwbhwwbQ+PtLdFk+63kSZLYdB1K+BvIA0GWmqpoj/c8gaSetPHPYXl/ojQvMA1Wg==;24:sTI8jYTXzee9ExOHHu64B9oS/AawJ1+BOAlgPQrTSZWo+AzlPRZJabyyB9LrcSYIf/6AjzVlvu8UIUWaLBKuYuaBqxv8SHxySISDB37VJzU=;20:ifdkMandOkSaGvUEcTvxu7CajKipz7AirDN3knm1FkQWvc/EEkEsInU0OmoCtCf2+eaPCdDICMguUXozhsLuEcQN2L7JbZgZGQxeM9pq5Hzx/H7pDL8fNEj3gvRJ+47rV5t6Sf92czXI17sJdZQC6xDSKR1wzTvmSypYJtG3xH2gHl5/bsjhs31cHr1FJ+O+G6ato8pjGECTIxMdD1M5w05nnCQuQlNx3FRE+TUIkQoFc0YrPlj9cjvRablDG8Ef x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR1201MB1021; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:DM3PR1201MB1021;BCL:0;PCL:0;RULEID:;SRVR:DM3PR1201MB1021; x-forefront-prvs: 09090B6B69 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(99286002)(3280700002)(1220700001)(106116001)(10400500002)(189998001)(66066001)(2906002)(9686002)(92566002)(4326007)(2950100001)(2900100001)(3660700001)(76576001)(81166005)(74316001)(122556002)(5008740100001)(19580405001)(19580395003)(5001770100001)(5003600100002)(33656002)(87936001)(11100500001)(86362001)(575784001)(76176999)(54356999)(5002640100001)(1096002)(5004730100002)(50986999)(586003)(6116002)(102836003)(3846002)(77096005);DIR:OUT;SFP:1101;SCL:1;SRVR:DM3PR1201MB1021;H:DM3PR1201MB1023.namprd12.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2016 07:22:52.4559 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR1201MB1021 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1035 Lines: 31 > From: Dan Carpenter [mailto:dan.carpenter@oracle.com] > Sent: Monday, April 11, 2016 3:15 PM > To: Joerg Roedel; Wan, Vincent > Cc: iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org; kernel- > janitors@vger.kernel.org > Subject: [patch] iommu/amd: Signedness bug in acpihid_device_group() > > "devid" needs to be signed for the error handling to work. > > Fixes:b097d11a0fa3f ('iommu/amd: Manage iommu_group for ACPI HID > devices') > Signed-off-by: Dan Carpenter > > diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c > index c430c10..12f7779 100644 > --- a/drivers/iommu/amd_iommu.c > +++ b/drivers/iommu/amd_iommu.c > @@ -283,7 +283,7 @@ static struct iommu_dev_data *get_dev_data(struct > device *dev) static struct iommu_group *acpihid_device_group(struct device > *dev) { > struct acpihid_map_entry *p, *entry = NULL; > - u16 devid; > + int devid; Sure, thanks for your patch. Wan Zongshun. > > devid = get_acpihid_device_id(dev, &entry); > if (devid < 0)