A fortunate result that comes from a mistake or misfortune — a lucky break or serendipitous success.
彼は試合で負けたが、怪我の功名でスポンサーがついた。
He lost the match, but by a lucky break a sponsor signed him.
予定が狂ったのは残念だったが、怪我の功名で思いがけない出会いがあった。
It was unfortunate that the schedule was disrupted, but by a lucky turn I had an unexpected meeting.
あの失敗が怪我の功名となり、商品が改良された。
That failure turned into a fortunate outcome and led to an improved product.