]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/isdn/hardware/mISDN/hfcpci.c
mISDN: array underflow in open_bchannel()
[mirror_ubuntu-bionic-kernel.git] / drivers / isdn / hardware / mISDN / hfcpci.c
index d055ae7fa040ff80fb77841e94e15d66575505ba..e2c83a2d76910629fc319d506af8735b323d080a 100644 (file)
@@ -1962,7 +1962,7 @@ open_bchannel(struct hfc_pci *hc, struct channel_req *rq)
 {
        struct bchannel         *bch;
 
-       if (rq->adr.channel > 2)
+       if (rq->adr.channel == 0 || rq->adr.channel > 2)
                return -EINVAL;
        if (rq->protocol == ISDN_P_NONE)
                return -EINVAL;