General Motors (GM) has recalled more than four million vehicles, most of them in the US, to fix an air bag software defect that has been linked to one death.

The vehicles involved in the recall are all from the 2014-2017 model years and include models from Buick, Chevrolet, GMC and Cadillac.

The company is recalling 4.28 million vehicles worldwide, with 3.6 million being in the US.

The company said Friday that in rare cases, the car's sensing and diagnostic module - a tiny computer that senses what the vehicle is doing and controls air bag deployment - can go into test mode. If that happens, the front air bags will not inflate in a crash and the seat belts may not work either.

GM said the defect is linked to at least one death and three injuries.

The company learned of the problem in May when a 2014 Chevrolet Silverado crashed and its air bags did not deploy.

GM notified Delphi Corp, the supplier that made the module. The two companies tested the modules and decided to recall the vehicles last week. The National Highway Traffic Safety Administration announced the recall on Friday.

General Motors Co will notify customers and update the software for free. GM said dealers already have access to the software update so they should be able to repair the vehicles quickly.