]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ssb: sdio: Don't overwrite const buffer if block_write fails
authorMichael Büsch <m@bues.ch>
Sat, 15 May 2021 19:02:52 +0000 (21:02 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 15 Jun 2021 10:10:59 +0000 (13:10 +0300)
It doesn't make sense to clobber the const driver-side buffer, if a
write-to-device attempt failed. All other SSB variants (PCI, PCMCIA and SoC)
also don't corrupt the buffer on any failure in block_write.
Therefore, remove this memset from the SDIO variant.

Signed-off-by: Michael Büsch <m@bues.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210515210252.318be2ba@wiggum
drivers/ssb/sdio.c

index 7fe0afb42234ff2ecd8db6b876fd5d7d72853064..66c5c2169704b878a783e5b599feae868b8b20b3 100644 (file)
@@ -411,7 +411,6 @@ static void ssb_sdio_block_write(struct ssb_device *dev, const void *buffer,
        sdio_claim_host(bus->host_sdio);
        if (unlikely(ssb_sdio_switch_core(bus, dev))) {
                error = -EIO;
-               memset((void *)buffer, 0xff, count);
                goto err_out;
        }
        offset |= bus->sdio_sbaddr & 0xffff;