Re: [PATCH 2/4] scsi: proc: use kmalloc() in proc writers
John Garry <[email protected]> Wed, 1 Jul 2026 11:52:21 +0100
| Newsgroups | org.kernel.vger.target-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-scsi,org.kvack.linux-mm |
|---|---|
| Organization | Oracle Corporation |
| Message-ID | <[email protected]> |
On 30/06/2026 11:54, Mike Rapoport (Microsoft) wrote: > if (!buf || length>PAGE_SIZE) > return -EINVAL; > - if (!(buffer = (char *) __get_free_page(GFP_KERNEL))) > + if (!(buffer = kmalloc(PAGE_SIZE, GFP_KERNEL))) > return -ENOMEM; It would have been nice to use standard coding style checks for allocation failures, i.e. buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!buffer) return -ENOMEM; > if (copy_from_user(buffer, buf Regardless of that: Reviewed-by: John Garry <[email protected]>