That's the layout of my disk. I want to merge free space to the primary partition without data loss.
Yes, you can merge the
3.2gb free space to your Ubuntu partition.
For this you need a gparted-live-disk.Because you cannot resize a mounted partition when the filesystem is mounted.
Boot into gparted live disk
Right Click on the Extended partition and select Move/Resize option, then add the unallocated 3.2 gb space to it.
Now the unallocated 3.2gb space comes under the extended partition.
Then rightclick on your Ubuntu ext4 partition and select Move/Resize option,now 3.2gb free space will be shown and you can add that.