Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3597940lfo; Mon, 23 May 2022 08:53:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz17e84N8vVny6QnDklvh8On8v+bQjA/Yjj2QxLU/QOJKBj3PKTnlLFfUMimRbkvQDqa3M9 X-Received: by 2002:a62:484:0:b0:50d:a020:88e5 with SMTP id 126-20020a620484000000b0050da02088e5mr24068375pfe.51.1653321235933; Mon, 23 May 2022 08:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653321235; cv=none; d=google.com; s=arc-20160816; b=F/68QBLcgPxL0mTODjczJssJXZZqYiUFFGdbMerXG1fY6PmIBQP5rgysiMyVYZwQ+4 9Nfdm7Xe+HCv3GM/K5KVFSxuJPOevw/QcbIvZSy5637IUYQz372wKsTbVmieL4Vys7wd EislgW+nyGwVPYFkIazr9JvorVPajM8rImKfddGcFf43VSnoqj5DpwLwER9sN1xZZ9sD KjmUlwF1JfMwGgQl6lOM/sDiZeTX0CwFMC6Jg5JP0RvIExdM9rgbDwLQOwvpRFqCMXFI /E1fEBvhNmTRaUDL8Fv9lhXUXbF18a6dhJ9AWGX95Wt3ee3VfdULRfqLNQokzyyyxYtT eUuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xHYLoQSTrdy4qwD76Z2uu/FuD5blKgW2dy/Qw1A6jhc=; b=XADPw/mt//9ixHiP34COquQTBnWWkBuNHvYmU5FLRd3dGLa/bIcKJSegai5MDqT2H6 zpAntbSm0fIAo2D1iA7L3iCpyA7qcZf1DPlvNmDlhhoH4i+BzZj6KHjcmxEwRKdE3R1D fMoBpMHNxYJQqHxSOX/adJGfnJwIXbMVFMDqsi5/+JeonzdUVwTVhS5dyAPxS4j3LZl1 HAk00n1J1/jJBDARkZM1MONZROtcz8sgfQ7ngAhKWweJak45XQSznHtjMgQ+CQXzyfeB R00AesTdi/t7g90vAIE8huRgJAQCFUrlqDu2MKORkp2JLAJohcqPN5mZikZHfYKWrqI6 //DA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o14-20020a635d4e000000b003daeb3ad0e3si3994007pgm.172.2022.05.23.08.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 08:53:55 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7CCB412753; Mon, 23 May 2022 08:51:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238159AbiEWPvJ (ORCPT + 99 others); Mon, 23 May 2022 11:51:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238186AbiEWPvH (ORCPT ); Mon, 23 May 2022 11:51:07 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 59AC12A9; Mon, 23 May 2022 08:51:01 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 0D3BD80C2; Mon, 23 May 2022 15:47:00 +0000 (UTC) From: Tony Lindgren To: Greg Kroah-Hartman Cc: Daniel Starke , Gregory CLEMENT , Jiri Slaby , Johan Hovold , Zhenguo Zhao , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Carpenter Subject: [PATCH] tty: n_gsm: Debug output allocation must use GFP_ATOMIC Date: Mon, 23 May 2022 18:50:52 +0300 Message-Id: <20220523155052.57129-1-tony@atomide.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Carpenter reported the following Smatch warning: drivers/tty/n_gsm.c:720 gsm_data_kick() warn: sleeping in atomic context This is because gsm_control_message() is holding a spin lock so gsm_hex_dump_bytes() needs to use GFP_ATOMIC instead of GFP_KERNEL. Fixes: 925ea0fa5277 ("tty: n_gsm: Fix packet data hex dump output") Reported-by: Dan Carpenter Signed-off-by: Tony Lindgren --- drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -459,7 +459,7 @@ static void gsm_hex_dump_bytes(const char *fname, const u8 *data, return; } - prefix = kasprintf(GFP_KERNEL, "%s: ", fname); + prefix = kasprintf(GFP_ATOMIC, "%s: ", fname); if (!prefix) return; print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 16, 1, data, len, -- 2.36.1