From: Michael Büsch Date: Sat, 15 May 2021 19:02:52 +0000 (+0200) Subject: ssb: sdio: Don't overwrite const buffer if block_write fails X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=47ec636f7a25aa2549e198c48ecb6b1c25d05456;p=linux.git ssb: sdio: Don't overwrite const buffer if block_write fails 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 Cc: stable@vger.kernel.org Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210515210252.318be2ba@wiggum --- diff --git a/drivers/ssb/sdio.c b/drivers/ssb/sdio.c index 7fe0afb42234f..66c5c2169704b 100644 --- a/drivers/ssb/sdio.c +++ b/drivers/ssb/sdio.c @@ -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;