]> git.baikalelectronics.ru Git - kernel.git/commit
devcoredump: remove the useless gfp_t parameter in dev_coredumpv and dev_coredumpm
authorDuoming Zhou <duoming@zju.edu.cn>
Tue, 7 Jun 2022 03:26:25 +0000 (11:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jun 2022 19:42:50 +0000 (21:42 +0200)
commit7c4030421622e2727304dcb92419755cf3a32f0b
tree2143168823d91232da4576a38f112a0cca51aefe
parentb6317279183d3f8b4ee382b1b72ebb769e381be7
devcoredump: remove the useless gfp_t parameter in dev_coredumpv and dev_coredumpm

The dev_coredumpv() and dev_coredumpm() could not be used in atomic
context, because they call kvasprintf_const() and kstrdup() with
GFP_KERNEL parameter. The process is shown below:

dev_coredumpv(.., gfp_t gfp)
  dev_coredumpm(.., gfp_t gfp)
    dev_set_name
      kobject_set_name_vargs
        kvasprintf_const(GFP_KERNEL, ...); //may sleep
          kstrdup(s, GFP_KERNEL); //may sleep

This patch removes gfp_t parameter of dev_coredumpv() and dev_coredumpm()
and changes the gfp_t parameter of kzalloc() in dev_coredumpm() to
GFP_KERNEL in order to show they could not be used in atomic context.

Fixes: 025f3652194a ("device coredump: add new device coredump class")
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/df72af3b1862bac7d8e793d1f3931857d3779dfd.1654569290.git.duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 files changed:
drivers/base/devcoredump.c
drivers/bluetooth/btmrvl_sdio.c
drivers/bluetooth/hci_qca.c
drivers/gpu/drm/etnaviv/etnaviv_dump.c
drivers/gpu/drm/msm/disp/msm_disp_snapshot.c
drivers/gpu/drm/msm/msm_gpu.c
drivers/media/platform/qcom/venus/core.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-dump.c
drivers/net/wireless/ath/ath10k/coredump.c
drivers/net/wireless/ath/wil6210/wil_crash_dump.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
drivers/net/wireless/marvell/mwifiex/main.c
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
drivers/net/wireless/mediatek/mt76/mt7921/mac.c
drivers/net/wireless/realtek/rtw88/main.c
drivers/net/wireless/realtek/rtw89/ser.c
drivers/remoteproc/qcom_q6v5_mss.c
drivers/remoteproc/remoteproc_coredump.c
include/drm/drm_print.h
include/linux/devcoredump.h
sound/soc/intel/avs/apl.c
sound/soc/intel/avs/skl.c
sound/soc/intel/catpt/dsp.c