aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2006-12-29 19:47:37 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-30 13:55:55 -0500
commit9d79f1b4677cfe503f721000529f1462ca7b6f6d (patch)
tree5aa6118178086942f7e96941536fe6ad0ab5df45 /drivers/infiniband
parent31f87cf48d54f5930e6e8e827989c18b0069c94a (diff)
[PATCH] IB/mthca: Fix FMR breakage caused by kmemdup() conversion
Commit bed8bdfd ("IB: kmemdup() cleanup") introduced one bad conversion to kmemdup() in mthca_alloc_fmr(), where the structure allocated and the structure copied are not the same size. Revert this back to the original kmalloc()/memcpy() code. Reported-by: Dotan Barak <dotanb@mellanox.co.il>. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <roland@digitalvampire.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 7ec7c4b937f9..7b96751695ea 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -1100,10 +1100,11 @@ static struct ib_fmr *mthca_alloc_fmr(struct ib_pd *pd, int mr_access_flags,
1100 struct mthca_fmr *fmr; 1100 struct mthca_fmr *fmr;
1101 int err; 1101 int err;
1102 1102
1103 fmr = kmemdup(fmr_attr, sizeof *fmr, GFP_KERNEL); 1103 fmr = kmalloc(sizeof *fmr, GFP_KERNEL);
1104 if (!fmr) 1104 if (!fmr)
1105 return ERR_PTR(-ENOMEM); 1105 return ERR_PTR(-ENOMEM);
1106 1106
1107 memcpy(&fmr->attr, fmr_attr, sizeof *fmr_attr);
1107 err = mthca_fmr_alloc(to_mdev(pd->device), to_mpd(pd)->pd_num, 1108 err = mthca_fmr_alloc(to_mdev(pd->device), to_mpd(pd)->pd_num,
1108 convert_access(mr_access_flags), fmr); 1109 convert_access(mr_access_flags), fmr);
1109 1110