Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1096209pxj; Sat, 29 May 2021 03:06:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHDRxnFjgp4k9Kr8GNErzoaEjgIGbnZkR9rNN/K8IUdoBkwCGdA6fvbQcobKqVXKpHqFRw X-Received: by 2002:a92:c5b1:: with SMTP id r17mr9710080ilt.255.1622282772817; Sat, 29 May 2021 03:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622282772; cv=none; d=google.com; s=arc-20160816; b=BgxAcKinQI+t1Bq3xi4mHzW0k6eddTBxkw188e3GLA6WycuK63mlQ5FV1co7ZfKiwm 9I8sMp46AaCzm7KRMEDQzwtaKJTc76cHmjaUC+ywY5UjXoP4KxMwHhDmNmN+quCD3V5e m6ZXl0nkXUTM6RhpI+HW6y/HF5qfndYcbIpQiWE5xs4nIQSU2REI/WD5QjdZObBw8KsJ gckexAJIH1sxQkyomxRg1G0iZ0iKnmq5Wg9uR55klUFOLGwWG41RyK/tgxnEuegWDL4T tteyXgcpeHegZSZdtZrgoIcrjO4pKR2o3YzhI6l5UnoxUtFXGNYdlibXrL/RvCR5Kg0Y /e9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=SgNX52kvrZEZbJ83Eqba9crMV07w0pa5kBmivpD5OuQ=; b=rJ5tVX1T4RbJa39591Do4QXkMHW68KqjcaAHGoI5gN8ORhEYV7nZ5WI1m+omxS6TAv THOthKiBqj3zWm+sUfqInc510rvECeqSpgsudNgxt6WD1HN2kFjDDg39oCBRPhwsrNbw +c6IzMXbK9Ma3ISeDgA6ltYkgHJk0CKBY4lhJfiI2kq/7Yn3O71eXb+I0o9i2rKi4SUq KYKGBfID0BslTgUjDqvtjjXOMWI46jXaMH6932QOVvEAH2eFO0fPHqm2Us/0NdF0iqec T7Ekqc8A6PwTJwZUOYytekRkn6McOyYXqsbR7aaS3/crFUX5Gd4Ve2Up2xsH371WkxnP GR0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rp0YAjZ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si9092017jad.108.2021.05.29.03.05.59; Sat, 29 May 2021 03:06:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rp0YAjZ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbhE2KFk (ORCPT + 99 others); Sat, 29 May 2021 06:05:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbhE2KFj (ORCPT ); Sat, 29 May 2021 06:05:39 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1883BC061574; Sat, 29 May 2021 03:04:03 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id y15so1185627pfl.4; Sat, 29 May 2021 03:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=SgNX52kvrZEZbJ83Eqba9crMV07w0pa5kBmivpD5OuQ=; b=rp0YAjZ9oGo86UUEa1UQPi2qp3kT3oVcPX+/l8dBTKf122VlRcvFZpk8KcLTBoJ3Z9 ++28pCdHzC38gQNZklBWtcAHLenZCq9E7szh9BDviIv9fADYwWHQfdHk+pS4pqL/b23S uo1n1zJ58mJ+EQz/rmm9yqrYdUbFXzcqrO9uztMPNUsudP5oItsuZoAb1YsqAHgWaxt9 TLLz2zgQEuDAgmVGf+n8aUAxaqsjsYz2tXkP4Gmgeiy15zfA9FuwVCpGlnfPwJx5FbJk c4bKmjjTtRIxvdCwPJBuVBLmpxGFrGoVJPwcLR9Zi4HfW0xSYoOusLrZqey9g2FCwT5U XBbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=SgNX52kvrZEZbJ83Eqba9crMV07w0pa5kBmivpD5OuQ=; b=UHnxJ0Dg4IC4xbyCabcWjyp7m07LEoHFfQdNrzYKmCS0z3U9y29IjvgPFqzE22/ahP lMs2duDm7GxJDYE9gdUmsZze939pEpy/Oa7cCIF9PB6Ip8IImyHezGHbzWs779ZiXrtv fbjXEkb7vIteE6UQcla/qtZ3S7xpW3UazU4A7LZgL/dGqnYBrUX6K+cTi+LZaa3uh1cF umu0x4ZRRxZR720UMb0cWH8MUZ5yD7yVOZzNsubkYeN0PkDTDZfFAfdOEGOkqvRVAmd0 f8TCEUkqAFGmCyPsYqB3g5eK7QwCEaPtTAzavifKZwZdmbZ3ktH5ugOYk7CaSyqudRnL lvxg== X-Gm-Message-State: AOAM533dLWrZyh5Q85Zz9l247pa2axvRVEJzuy4FU88ubwNg7aO2mnNx 5yc8H30Kk8PTULuwhxmf6ws= X-Received: by 2002:a63:36ce:: with SMTP id d197mr13144336pga.151.1622282642497; Sat, 29 May 2021 03:04:02 -0700 (PDT) Received: from hyeyoo ([183.99.11.150]) by smtp.gmail.com with ESMTPSA id o134sm6377612pfd.58.2021.05.29.03.04.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 May 2021 03:04:02 -0700 (PDT) Date: Sat, 29 May 2021 19:03:57 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Jiri Kosina , Benjamin Tissoires Cc: linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: usbkbd: Avoid GFP_ATOMIC when GFP_KERNEL is possible Message-ID: <20210529100357.GA46765@hyeyoo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org usb_kbd_alloc_mem is called in usb_kbd_probe, which is not in atomic context. So constraints can be relaxed here. Use GFP_KERNEL instead of GFP_ATOMIC. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- drivers/hid/usbhid/usbkbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index e22434dfc9ef..df02002066ce 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c @@ -239,11 +239,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) return -1; if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL))) return -1; - if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma))) + if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbd->new_dma))) return -1; if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL))) return -1; - if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) + if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_KERNEL, &kbd->leds_dma))) return -1; return 0; -- 2.25.1