diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-08-25 11:24:28 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-22 15:22:27 -0700 |
commit | 8e280d94e29af67035637fb957daba7ae0d23583 (patch) | |
tree | eb95b5a5f8eecee6b8f0b0aacb5da14a05d514fa /drivers/infiniband | |
parent | c27fef26271d352b5546c33239edeb0dcb4fc0cc (diff) | |
download | linux-8e280d94e29af67035637fb957daba7ae0d23583.tar.gz linux-8e280d94e29af67035637fb957daba7ae0d23583.tar.bz2 linux-8e280d94e29af67035637fb957daba7ae0d23583.zip |
IB/ipath: fix for crash on module unload, if cfgports < portcnt
Allocate enough pointers for all possible ports, to avoid problems in
cleanup/unload.
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_init_chip.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c index 414cdd1d80a6..c63de8f0fa9e 100644 --- a/drivers/infiniband/hw/ipath/ipath_init_chip.c +++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c @@ -240,7 +240,11 @@ static int init_chip_first(struct ipath_devdata *dd, "only supports %u\n", ipath_cfgports, dd->ipath_portcnt); } - dd->ipath_pd = kzalloc(sizeof(*dd->ipath_pd) * dd->ipath_cfgports, + /* + * Allocate full portcnt array, rather than just cfgports, because + * cleanup iterates across all possible ports. + */ + dd->ipath_pd = kzalloc(sizeof(*dd->ipath_pd) * dd->ipath_portcnt, GFP_KERNEL); if (!dd->ipath_pd) { |