diff options
Diffstat (limited to 'drivers/net/hamradio/mkiss.c')
-rw-r--r-- | drivers/net/hamradio/mkiss.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 4c628393c8b1..0e4f23531140 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -923,13 +923,14 @@ static long mkiss_compat_ioctl(struct tty_struct *tty, struct file *file, | |||
923 | * a block of data has been received, which can now be decapsulated | 923 | * a block of data has been received, which can now be decapsulated |
924 | * and sent on to the AX.25 layer for further processing. | 924 | * and sent on to the AX.25 layer for further processing. |
925 | */ | 925 | */ |
926 | static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp, | 926 | static unsigned int mkiss_receive_buf(struct tty_struct *tty, |
927 | char *fp, int count) | 927 | const unsigned char *cp, char *fp, int count) |
928 | { | 928 | { |
929 | struct mkiss *ax = mkiss_get(tty); | 929 | struct mkiss *ax = mkiss_get(tty); |
930 | int bytes = count; | ||
930 | 931 | ||
931 | if (!ax) | 932 | if (!ax) |
932 | return; | 933 | return -ENODEV; |
933 | 934 | ||
934 | /* | 935 | /* |
935 | * Argh! mtu change time! - costs us the packet part received | 936 | * Argh! mtu change time! - costs us the packet part received |
@@ -939,7 +940,7 @@ static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
939 | ax_changedmtu(ax); | 940 | ax_changedmtu(ax); |
940 | 941 | ||
941 | /* Read the characters out of the buffer */ | 942 | /* Read the characters out of the buffer */ |
942 | while (count--) { | 943 | while (bytes--) { |
943 | if (fp != NULL && *fp++) { | 944 | if (fp != NULL && *fp++) { |
944 | if (!test_and_set_bit(AXF_ERROR, &ax->flags)) | 945 | if (!test_and_set_bit(AXF_ERROR, &ax->flags)) |
945 | ax->dev->stats.rx_errors++; | 946 | ax->dev->stats.rx_errors++; |
@@ -952,6 +953,8 @@ static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
952 | 953 | ||
953 | mkiss_put(ax); | 954 | mkiss_put(ax); |
954 | tty_unthrottle(tty); | 955 | tty_unthrottle(tty); |
956 | |||
957 | return count; | ||
955 | } | 958 | } |
956 | 959 | ||
957 | /* | 960 | /* |