Skip to content

Commit 4332be8

Browse files
committed
ntb_hw_switchtec: Fix another ntb_mw_clear_trans error if size == 0
ntb_mw_set_trans() should work as ntb_mw_clear_trans() when size == 0 and/or addr == 0. Check alignment only when size is not zero.
1 parent bd34ab3 commit 4332be8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ntb_hw_switchtec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx,
383383
if (size != 0 && xlate_pos < 12)
384384
return -EINVAL;
385385

386-
if (!IS_ALIGNED(addr, BIT_ULL(xlate_pos))) {
386+
if (size != 0 && !IS_ALIGNED(addr, BIT_ULL(xlate_pos))) {
387387
/*
388388
* In certain circumstances we can get a buffer that is
389389
* not aligned to its size. (Most of the time

0 commit comments

Comments
 (0)