Commit 5ff75c48 authored by YueHaibing's avatar YueHaibing Committed by Noralf Trønnes
Browse files

drm/tinydrm: Use kmemdup rather than duplicating its implementation in repaper_spi_transfer()

parent 77e9c35a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -108,12 +108,11 @@ static int repaper_spi_transfer(struct spi_device *spi, u8 header,

	/* Stack allocated tx? */
	if (tx && len <= 32) {
		txbuf = kmalloc(len, GFP_KERNEL);
		txbuf = kmemdup(tx, len, GFP_KERNEL);
		if (!txbuf) {
			ret = -ENOMEM;
			goto out_free;
		}
		memcpy(txbuf, tx, len);
	}

	if (rx) {