From patchwork Wed Nov 15 20:21:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Limonciello, Mario" X-Patchwork-Id: 10060175 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 26B916056E for ; Wed, 15 Nov 2017 20:21:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2748829BFE for ; Wed, 15 Nov 2017 20:21:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C1B52A2C5; Wed, 15 Nov 2017 20:21:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E16F29E18 for ; Wed, 15 Nov 2017 20:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933649AbdKOUVo (ORCPT ); Wed, 15 Nov 2017 15:21:44 -0500 Received: from esa4.dell-outbound.iphmx.com ([68.232.149.214]:17243 "EHLO esa4.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933579AbdKOUVW (ORCPT ); Wed, 15 Nov 2017 15:21:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1510777282; x=1542313282; h=from:to:cc:subject:date:message-id; bh=6TTld2IcRlb33zDhNYMD+879tePh0nLL64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dWHSu?= =?us-ascii?q?dl8kehxzmP0wfT5/laLkAvj6XWKoQtzaMumZoXtUTPByj2mFjqjKCNcUUk5+6o?= =?us-ascii?q?5Pn5brn8p5+cL490igTxM6g0hsO/BuE4PhAPX2id5+u8yKXu8Ez6TblQkPE7nL?= =?us-ascii?q?fVvIrHKckbqaO1GQtY34I75xa6FTim0dAYnXcdLFJCfRKKl43pNEvUIPD5Cvez?= =?us-ascii?q?mVCskDZux/DBOL3uHpTNIWbHkLflerZw8FNTxxQ3zdBb/Z5bFrYBIPfrVk/rqN?= =?us-ascii?q?PYFgM5MxCzw+v/DNV914UeWX+AA6OAM6Pdr0WI5uQxLOmIf4IVpjn9JOY/5/L0?= =?us-ascii?q?jn82h0Udfa+30psTcny4Ge5mI0qBa3r2ntgBCXsKvhY5TOHykF2CVSRcZ2q8X6?= =?us-ascii?q?I7/DE7DZuqAprZRoCsnryOwj27EoRZZ21FC12BCmnod4qaVPcWci6SIdFukiYC?= =?us-ascii?q?Vbe/T48tzxautBX1y+kvEu2B9jMYvIj//Nlz6ffamRw7+XpzFcvZm0iLQ3A8pW?= =?us-ascii?q?MFWTQ20aZ8pgQpw1GPwO5jg/FGHtxe4fBOegg/PJ/Yied9DoahdBjGe4KsQUyn?= =?us-ascii?q?RZ2CADQ2SNkwztsKZA4pHty4jxeF2yuvBLkelrGPAJsc/q/Y2z76IMMrmCWO77?= =?us-ascii?q?Uok1RzGpgHDmahnKMqslGLX4M=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2E/AAA6oQxah2Oa6EReGgEBAQEBAgEBA?= =?us-ascii?q?QEIAQEBAYUIJ44ejyCYWoIRCoU7hRA/GAEBAQEBAQEBAQECEAEBAQoLCQgoL4I?= =?us-ascii?q?4JAGCb1JPbwESiiSrcDqLQoM0ggeBVZAjBZMFjzKCNZJRApNAApYugTkfgi16g?= =?us-ascii?q?0KCDAFPEAyCBliMEAEBAQ?= X-IPAS-Result: =?us-ascii?q?A2E/AAA6oQxah2Oa6EReGgEBAQEBAgEBAQEIAQEBAYUIJ44?= =?us-ascii?q?ejyCYWoIRCoU7hRA/GAEBAQEBAQEBAQECEAEBAQoLCQgoL4I4JAGCb1JPbwESi?= =?us-ascii?q?iSrcDqLQoM0ggeBVZAjBZMFjzKCNZJRApNAApYugTkfgi16g0KCDAFPEAyCBli?= =?us-ascii?q?MEAEBAQ?= Received: from esa6.dell-outbound2.iphmx.com ([68.232.154.99]) by esa4.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2017 14:21:21 -0600 Received: from ausc60pc101.us.dell.com ([143.166.85.206]) by esa6.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Nov 2017 02:21:20 +0600 X-LoopCount0: from 10.208.86.39 X-IronPort-AV: E=Sophos;i="5.44,399,1505797200"; d="scan'208";a="1178685404" X-DLP: DLP_GlobalPCIDSS From: Mario Limonciello To: dvhart@infradead.org, Andy Shevchenko Cc: LKML , platform-driver-x86@vger.kernel.org, valdis.kletnieks@vt.edu, Mario Limonciello Subject: [PATCH] platform/x86: dell-laptop: Allocate buffer before rfkill use Date: Wed, 15 Nov 2017 14:21:13 -0600 Message-Id: <1510777273-31322-1-git-send-email-mario.limonciello@dell.com> X-Mailer: git-send-email 2.7.4 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On machines using rfkill interface the buffer needs to have been allocated before the initial use (memset) of it. Reported-by: Valdis Kletnieks Signed-off-by: Mario Limonciello --- drivers/platform/x86/dell-laptop.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index c4903c5..2d70436 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -2073,6 +2073,11 @@ static int __init dell_init(void) if (ret) goto fail_platform_device2; + buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL); + if (!buffer) + goto fail_buffer; + + ret = dell_setup_rfkill(); if (ret) { @@ -2080,10 +2085,6 @@ static int __init dell_init(void) goto fail_rfkill; } - buffer = kzalloc(sizeof(struct calling_interface_buffer), GFP_KERNEL); - if (!buffer) - goto fail_buffer; - if (quirks && quirks->touchpad_led) touchpad_led_init(&platform_device->dev);