Re: [PATCH 2/4] scsi: proc: use kmalloc() in proc writers
From: Hannes Reinecke
Date: Wed Jul 01 2026 - 03:00:18 EST
On 6/30/26 12:54 PM, Mike Rapoport (Microsoft) wrote:
proc_scsi_host_write(), proc_scsi_write() and proc_scsi_devinfo_write()Reviewed-by: Hannes Reinecke <hare@xxxxxxxxxx>
allocate temporary buffers for /proc writes using __get_free_page().
These buffers can be allocated with kmalloc() as there's nothing special
about them to go directly to the page allocator.
kmalloc() provides a better API that does not require ugly casts and
kfree() does not need to know the size of the freed object.
Replace use of __get_free_page() with kmalloc().
Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@xxxxxxxxxx
Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
---
drivers/scsi/scsi_devinfo.c | 4 ++--
drivers/scsi/scsi_proc.c | 9 +++++----
2 files changed, 7 insertions(+), 6 deletions(-)
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich