Consider we have two processes P1 and P2. There are also two semaphores M and N which are initialized to zero. Here's how they execute:
+-----------+-----------+
| P1 | P2 |
+-----------+-----------+
| wait(M) | wait(N) |
| ... | ... |
| wait(N) | wait(M) |
| ... | ... |
| signal(N) | signal(M) |
| signal(M) | signal(N) |
+-----------+-----------+
So neither of the process will go through the first statement because the value of both M and N are zero, so they both get blocked.
But if the initialization value for both M and N were 1, then they successfully execute, with no deadlock.
Can this be considered deadlock solely because of the faulty initialization of the semaphore?