Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1449772ybe; Wed, 11 Sep 2019 15:25:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmlQSAJ2e6rIGDVp/dB5hVQOVPCEvTS5RsReqpkQ7DRI+w+FVn9iiXI5vzeJeet9IKSzow X-Received: by 2002:a50:9e6c:: with SMTP id z99mr37980764ede.200.1568240732829; Wed, 11 Sep 2019 15:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568240732; cv=none; d=google.com; s=arc-20160816; b=JCul2xS4HMgDk1y7pD88B4tfe6hbWFxRwAubu3O+dyNQ1Jx5Cv8ycPD2sZrFwQ4a1p 6gRtS8JKEfS1C7po10hezbI5nSxmeTaOfscM0CbJsZfbiqhPxm/Cnra1VHX2mEWwIqHy Jw96OIZx6O1fklPza0RCKvtne4VJVaD0wAcKLgCX81tRumu8Q8rF6UCgBCXapBgvJ9br cfd93pfSfRS/hG+2n0CbLgVlGOK4l+Yz42cUd+4B31YMjadF74Or/pnZQhiTuO6AzSK7 p0XiOodHf/ndBJ0tUGTvqzkG0MRVWEPXAi510qRDUvNXOLU/Dm4SHCu63NI1HU2ctBux YMtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature; bh=AaoYh6FCL48C0R8R/wQ/0i195JUsJd9aoZEgjtS/br0=; b=fh1QSXIkCABi7eQKlqqVsB2c7QuUCKH0JlDVY5AKsQhsUFerMWgaaSUi2RMGQGNP2t G2fM2phJnjFxkvNOMnnUgWY2hrSYo9LKYgzKmVoBk4LxNKWHOYFZjyrIyhHD870M3NSm 2sC/2LW22vekSbOeanYTt/8gA7wQP5bbH6z+oTKX+JNHVQXonGrozZmPrXi/OxVXmHDF KejkkUf89YZyCn6H/FNc8Jqif620UwFu6ngnCAkkEz5MQvVnQknvSU17toGdLqwcRRhL vXBL2D+2wtzHgPnMjUlW42BvvA99AX1HFIslAFIxfTnL+jh0R40NENINJcUOWIFOR2/I jetQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rHklITN4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23si12768172edp.443.2019.09.11.15.25.09; Wed, 11 Sep 2019 15:25:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rHklITN4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729385AbfIKULL (ORCPT + 99 others); Wed, 11 Sep 2019 16:11:11 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:33511 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728808AbfIKULL (ORCPT ); Wed, 11 Sep 2019 16:11:11 -0400 Received: by mail-io1-f67.google.com with SMTP id m11so48951035ioo.0 for ; Wed, 11 Sep 2019 13:11:09 -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=AaoYh6FCL48C0R8R/wQ/0i195JUsJd9aoZEgjtS/br0=; b=rHklITN4LJr5H01xXlNHodUsQvBy61D2d6Ki4fuu4CCfTSrTTqhlHScSIPzzX7/+JH 4M2+FYVswyuU+J5zkNQv2gt4RWbpwFnGTMOwa4SwHRXl0rZr649ggWZeRy7Hb1YjYGqX nccd1hTgxNhVcSHn7SzWd5pemJnlKIXKil3o1jqkx6SwrKsgRksJPp9p9tlWyKkQvIuR /Shi0XcCG2dV4gjgDslIgs6OJpkeMLHeDyhGmfo6DARxu+afJZQSTnFE60zSZSsUlWIM 9FsTuBUxGCBmlhnCeiWxNc84AV3BDKamJneOT+Kt3iwfwdC3borsXvHaaUSCCVJxHK/I 9h3w== 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=AaoYh6FCL48C0R8R/wQ/0i195JUsJd9aoZEgjtS/br0=; b=OJCiFMafybIYNF2/ysKlrh7njdrhKXUWqPJDfcilkvjyOC2/tKYh7S/kH24OfMJn43 r6wFVr08jrWACu9ozIyOzwPCSAR6zLTlLnxBE2PmMdLGbcr6yvD26n33DDaMgrouYlK/ MbPZ+28uguLXxDlRiT49fxpbPocsRrRNV7fl6k4pNUQ4W/HWUJIXeQRgeAOtZdhHjGRR txCy/3LJ/yXTX05LexslPZ4BT3xBtt4X2tSzzfjqaWgSsk2fMNuysg9CFm7K62NZYea1 WsA6FpKdPH9KKV5wc41ct6uN/w9wtBdKsai1Wg6xF+3SnpnP3GR5yisE/Dyr4dUyQYHh FSiA== X-Gm-Message-State: APjAAAWlpHITaff+EjOk6tPh6XaHTFzqORMxx4ri+xozgP83HffAdd1J CcMAGId/si5CMAmQVSQClek= X-Received: by 2002:a5d:9856:: with SMTP id p22mr8271529ios.231.1568232669164; Wed, 11 Sep 2019 13:11:09 -0700 (PDT) Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) by smtp.googlemail.com with ESMTPSA id l1sm9837ioc.30.2019.09.11.13.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 13:11:08 -0700 (PDT) From: Navid Emamdoost Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, Navid Emamdoost , Benson Leung , Enric Balletbo i Serra , linux-kernel@vger.kernel.org Subject: [PATCH] platform/chrome: null check create_singlethread_workqueue Date: Wed, 11 Sep 2019 15:10:59 -0500 Message-Id: <20190911201100.11483-1-navid.emamdoost@gmail.com> X-Mailer: git-send-email 2.17.1 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In cros_usbpd_logger_probe the return value of create_singlethread_workqueue may be null, it should be checked. Signed-off-by: Navid Emamdoost --- drivers/platform/chrome/cros_usbpd_logger.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/platform/chrome/cros_usbpd_logger.c b/drivers/platform/chrome/cros_usbpd_logger.c index 7c7b267626a0..c83397955cc3 100644 --- a/drivers/platform/chrome/cros_usbpd_logger.c +++ b/drivers/platform/chrome/cros_usbpd_logger.c @@ -209,6 +209,9 @@ static int cros_usbpd_logger_probe(struct platform_device *pd) /* Retrieve PD event logs periodically */ INIT_DELAYED_WORK(&logger->log_work, cros_usbpd_log_check); logger->log_workqueue = create_singlethread_workqueue("cros_usbpd_log"); + if (!logger->log_workqueue) + return -ENOMEM; + queue_delayed_work(logger->log_workqueue, &logger->log_work, CROS_USBPD_LOG_UPDATE_DELAY); -- 2.17.1