The D502 is most likely a BCW61A
it could be a BAS40PT as it's also a SOT-23 with the marking BA....
could even be MMBZ5241B as it's also a SOT-23 with the marking BA...........
but by the picture it seems that the front leg of the SOT is still intact.