aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/sx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/sx.c')
-rw-r--r--drivers/char/sx.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index b60be7b0decf..518f2a25d91e 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1713,8 +1713,8 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
1713 for (i = 0; i < SX_NBOARDS; i++) 1713 for (i = 0; i < SX_NBOARDS; i++)
1714 sx_dprintk(SX_DEBUG_FIRMWARE, "<%x> ", boards[i].flags); 1714 sx_dprintk(SX_DEBUG_FIRMWARE, "<%x> ", boards[i].flags);
1715 sx_dprintk(SX_DEBUG_FIRMWARE, "\n"); 1715 sx_dprintk(SX_DEBUG_FIRMWARE, "\n");
1716 unlock_kernel(); 1716 rc = -EIO;
1717 return -EIO; 1717 goto out;
1718 } 1718 }
1719 1719
1720 switch (cmd) { 1720 switch (cmd) {
@@ -1746,8 +1746,10 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
1746 sx_dprintk(SX_DEBUG_FIRMWARE, "returning type= %ld\n", rc); 1746 sx_dprintk(SX_DEBUG_FIRMWARE, "returning type= %ld\n", rc);
1747 break; 1747 break;
1748 case SXIO_DO_RAMTEST: 1748 case SXIO_DO_RAMTEST:
1749 if (sx_initialized) /* Already initialized: better not ramtest the board. */ 1749 if (sx_initialized) { /* Already initialized: better not ramtest the board. */
1750 return -EPERM; 1750 rc = -EPERM;
1751 break;
1752 }
1751 if (IS_SX_BOARD(board)) { 1753 if (IS_SX_BOARD(board)) {
1752 rc = do_memtest(board, 0, 0x7000); 1754 rc = do_memtest(board, 0, 0x7000);
1753 if (!rc) 1755 if (!rc)
@@ -1787,7 +1789,7 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
1787 nbytes - i : SX_CHUNK_SIZE)) { 1789 nbytes - i : SX_CHUNK_SIZE)) {
1788 kfree(tmp); 1790 kfree(tmp);
1789 rc = -EFAULT; 1791 rc = -EFAULT;
1790 break; 1792 goto out;
1791 } 1793 }
1792 memcpy_toio(board->base2 + offset + i, tmp, 1794 memcpy_toio(board->base2 + offset + i, tmp,
1793 (i + SX_CHUNK_SIZE > nbytes) ? 1795 (i + SX_CHUNK_SIZE > nbytes) ?
@@ -1844,6 +1846,7 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
1844 rc = -ENOTTY; 1846 rc = -ENOTTY;
1845 break; 1847 break;
1846 } 1848 }
1849out:
1847 unlock_kernel(); 1850 unlock_kernel();
1848 func_exit(); 1851 func_exit();
1849 return rc; 1852 return rc;