diff options
Diffstat (limited to 'drivers/net/hamradio/hdlcdrv.c')
-rw-r--r-- | drivers/net/hamradio/hdlcdrv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index 8c3633c1d078..97e3bc60c3e7 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -576,6 +576,8 @@ static int hdlcdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
576 | case HDLCDRVCTL_CALIBRATE: | 576 | case HDLCDRVCTL_CALIBRATE: |
577 | if(!capable(CAP_SYS_RAWIO)) | 577 | if(!capable(CAP_SYS_RAWIO)) |
578 | return -EPERM; | 578 | return -EPERM; |
579 | if (s->par.bitrate <= 0) | ||
580 | return -EINVAL; | ||
579 | if (bi.data.calibrate > INT_MAX / s->par.bitrate) | 581 | if (bi.data.calibrate > INT_MAX / s->par.bitrate) |
580 | return -EINVAL; | 582 | return -EINVAL; |
581 | s->hdlctx.calibrate = bi.data.calibrate * s->par.bitrate / 16; | 583 | s->hdlctx.calibrate = bi.data.calibrate * s->par.bitrate / 16; |