From patchwork Thu May 24 11:35:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eyal Reizer X-Patchwork-Id: 10424395 X-Patchwork-Delegate: kvalo@adurom.com 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 B39AC6019D for ; Thu, 24 May 2018 11:35:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB7CC2941B for ; Thu, 24 May 2018 11:35:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E17429424; Thu, 24 May 2018 11:35:50 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 16B802941C for ; Thu, 24 May 2018 11:35:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969038AbeEXLfr (ORCPT ); Thu, 24 May 2018 07:35:47 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37664 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967464AbeEXLfp (ORCPT ); Thu, 24 May 2018 07:35:45 -0400 Received: by mail-wr0-f194.google.com with SMTP id i12-v6so2488948wrc.4 for ; Thu, 24 May 2018 04:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=MPPV2P5TweduqFWs1mxL9ccH2w34VmLR1usJGer7WAk=; b=NuM0IO5ZM3K9c2BAkEKBcFuWYv446pVQCjJyNtd1zGbbfpQboXaVjH/5SUhOrRO9sw soOxgXgjHJHeo4tHeZmwy0TNsO7hOVuKi3L6L8ajVYrpVxQdK2Rd5gyWn/HMAtUPR7SV YkRdr+8VsoibjbA5NThqrrsfayNQ866nL6i+et5jfOLMbhHnQTBjRAMN5QJkW5VkSaKh jmj6s2J99DVy8nPABkEbVIA0sRc9aENwMQ8YorQdIEOep+OHi7hPmcbCI6EzI6MCEHbi m7zQ1sEczbR2zin6nCOiqZKO7GsbPuDgtJWk1lc3MKatajyOb96EABGJtW3zRUqoiSIU 0tEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MPPV2P5TweduqFWs1mxL9ccH2w34VmLR1usJGer7WAk=; b=Nrv2cUfhVC3fjnblBHTVNEPeDn5YgTGi8OoeVJVIRKiaNisg7QDZ5WmrNi7uDZ+RWf azE9sljQpJmwo3kLFpbCLGuM23sTBa0oB8IJG1NxU+fjvdfPm0Q9ajM2ddaSHrd/jL8A UWJ5LfTC+bDtJsl6CxGI2pLamyCYfQ90YKjOi4cJas1Gc8RnrIcrlwAz5SUhdDM5kbZC X3ozCFQyBDJ71ySJUD0krXrhBrOWHv0ZxfplPdscoTvnyi69TfsPbfQZxoXL4wXmUNQr CBpuhEkKMOetUHYB/EmSs0ykqzqmPIARStGRu/pk+cEFnytdAAq0JSaOzG7gpvnYbks+ rNKw== X-Gm-Message-State: ALKqPwdmb67pdPTTQOpNiikIxMpay+37rQxxFj0X9EacEB/dVi6voNzz bsgh/z66ohmu+WOmiq33w0Q= X-Google-Smtp-Source: AB8JxZqOvsFBkAb3Yb0PlxpUZ2Ddbrbc6wtrJ5ZTUpFcEeyr/FDqee4Hp8M/CFJccbpNy3+d7yHy2w== X-Received: by 2002:adf:87d0:: with SMTP id c16-v6mr5326040wrc.246.1527161743817; Thu, 24 May 2018 04:35:43 -0700 (PDT) Received: from localhost.localdomain ([141.226.181.188]) by smtp.gmail.com with ESMTPSA id g105-v6sm33314435wrd.45.2018.05.24.04.35.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 May 2018 04:35:42 -0700 (PDT) From: Eyal Reizer X-Google-Original-From: Eyal Reizer To: kvalo@codeaurora.org, tony@atomide.com, nsekhar@ti.com, linux-wireless@vger.kernel.org Cc: Eyal Reizer Subject: [PATCH] wlcore: sdio: check for valid platform device data before suspend Date: Thu, 24 May 2018 14:35:30 +0300 Message-Id: <1527161730-9044-1-git-send-email-eyalr@ti.com> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP the wl pointer can be null In case only wlcore_sdio is probed while no WiLink module is successfully probed, as in the case of mounting a wl12xx module while using a device tree file configured with wl18xx related settings. In this case the system was crashing in wl1271_suspend() as platform device data is not set. Make sure wl the pointer is valid before using it. Signed-off-by: Eyal Reizer mamai --- drivers/net/wireless/ti/wlcore/sdio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c index da701cd..aec6225 100644 --- a/drivers/net/wireless/ti/wlcore/sdio.c +++ b/drivers/net/wireless/ti/wlcore/sdio.c @@ -406,6 +406,11 @@ static int wl1271_suspend(struct device *dev) mmc_pm_flag_t sdio_flags; int ret = 0; + if (!wl) { + dev_err(dev, "no wilink module was probed\n"); + goto out; + } + dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n", wl->wow_enabled);