Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'spi-fix-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fix from Mark Brown:
"One fix for type conversion issues when working out maximum
scatter/gather segment sizes.

It caused problems for some systems where the limits overflow
due to the type conversion"

* tag 'spi-fix-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: Fix invalid sgs value

+2 -2
+2 -2
drivers/spi/spi.c
··· 1019 1019 int i, ret; 1020 1020 1021 1021 if (vmalloced_buf || kmap_buf) { 1022 - desc_len = min_t(int, max_seg_size, PAGE_SIZE); 1022 + desc_len = min_t(unsigned int, max_seg_size, PAGE_SIZE); 1023 1023 sgs = DIV_ROUND_UP(len + offset_in_page(buf), desc_len); 1024 1024 } else if (virt_addr_valid(buf)) { 1025 - desc_len = min_t(int, max_seg_size, ctlr->max_dma_len); 1025 + desc_len = min_t(unsigned int, max_seg_size, ctlr->max_dma_len); 1026 1026 sgs = DIV_ROUND_UP(len, desc_len); 1027 1027 } else { 1028 1028 return -EINVAL;