To decide whether passengers have adequate documents to be admitted to their destination country, airlines use a database called TIMATIC. This is part of what it says about a South African passport holder who is resident in the UK flying from South Africa to the UK:
Passports and other documents accepted for entry issued to residents of the United Kingdom must be valid on arrival.
Since you will be arriving before your passport expires, there should be no problem.
It goes on to list several requirements for residence permits to be accepted. I presume you meet one of these, but for the sake of thoroughness, I will list them so you can decide for yourself:
Passengers with a biometric residence permit (with an electronic chip symbol) issued by the United Kingdom if:
- the last permission (leave) to enter or remain in the United Kingdom was given for a period of more than six months ; or
- the last permission reads: "Given leave to enter to complete previous leave Section 3(3)(b)" ; or
- passenger is a permanent resident of the United Kingdom returning within two years ; or
- passenger has a passport with a Certificate of Entitlement to the Right of Abode issued by the United Kingdom.
•The two year restriction does not apply to accompanying spouses and children of military personnel returning to the United Kingdom.
Passengers with an EEA Family Residence Card issued by the United Kingdom.
Passengers with an EEA Family Permit issued by the United Kingdom if the holder is traveling with, or to join the EEA or Swiss national.