Commit:     9d79f1b4677cfe503f721000529f1462ca7b6f6d
Parent:     31f87cf48d54f5930e6e8e827989c18b0069c94a
Author:     Michael S. Tsirkin <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 29 16:47:37 2006 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Dec 30 10:55:55 2006 -0800

    [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 <[EMAIL PROTECTED]>.
    Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 drivers/infiniband/hw/mthca/mthca_provider.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c 
index 7ec7c4b..7b96751 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,
        struct mthca_fmr *fmr;
        int err;
-       fmr = kmemdup(fmr_attr, sizeof *fmr, GFP_KERNEL);
+       fmr = kmalloc(sizeof *fmr, GFP_KERNEL);
        if (!fmr)
                return ERR_PTR(-ENOMEM);
+       memcpy(&fmr->attr, fmr_attr, sizeof *fmr_attr);
        err = mthca_fmr_alloc(to_mdev(pd->device), to_mpd(pd)->pd_num,
                             convert_access(mr_access_flags), fmr);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to